Submission #4866932


Source Code Expand

Copy
X, Y, Z, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

result = []
for i in range(X):
    for j in range(Y):
        for k in range(Z):
            if (i + 1) * (j + 1) * (k + 1) <= K:
                result.append(A[i] + B[j] + C[k])
            else:
                break
result.sort(reverse=True)
for rs in result[:K]:
    print(rs)

Submission Info

Submission Time
Task D - Cake 123
User showyou41
Language Python3 (3.4.3)
Score 400
Code Size 512 Byte
Status
Exec Time 654 ms
Memory 8708 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 s1.txt, s2.txt, s3.txt
All 400 / 400 in01.txt, in02.txt, in03.txt, in04.txt, in05.txt, in06.txt, in07.txt, in08.txt, in09.txt, in10.txt, in11.txt, in12.txt, in13.txt, in14.txt, in15.txt, in16.txt, in17.txt, in18.txt, in19.txt, in20.txt, in21.txt, in22.txt, in23.txt, s1.txt, s2.txt, s3.txt
Case Name Status Exec Time Memory
in01.txt 633 ms 8640 KB
in02.txt 647 ms 8652 KB
in03.txt 622 ms 8636 KB
in04.txt 654 ms 8616 KB
in05.txt 634 ms 8624 KB
in06.txt 630 ms 8664 KB
in07.txt 635 ms 7784 KB
in08.txt 629 ms 7852 KB
in09.txt 635 ms 7804 KB
in10.txt 624 ms 7880 KB
in11.txt 635 ms 7880 KB
in12.txt 619 ms 7876 KB
in13.txt 620 ms 8408 KB
in14.txt 621 ms 8280 KB
in15.txt 617 ms 8280 KB
in16.txt 17 ms 3064 KB
in17.txt 17 ms 3064 KB
in18.txt 632 ms 8708 KB
in19.txt 640 ms 8640 KB
in20.txt 616 ms 8516 KB
in21.txt 631 ms 8708 KB
in22.txt 635 ms 8612 KB
in23.txt 618 ms 8528 KB
s1.txt 17 ms 3064 KB
s2.txt 17 ms 3064 KB
s3.txt 17 ms 3064 KB