Submission #16520554


Source Code Expand

Copy
N, M = map(int,input().split())

dp = [[[0 for i in range(101)] for j in range(101)] for k in range(101)]

for _ in range(N):
    a, b, c, w = map(int,input().split())
    dp[a][b][c] = max(w, dp[a][b][c])

for a in range(101):
    for b in range(101):
        for c in range(101):
            if a > 0:
                dp[a][b][c] = max(dp[a][b][c], dp[a-1][b][c])
            if b > 0:
                dp[a][b][c] = max(dp[a][b][c], dp[a][b-1][c])
            if a > 0:
                dp[a][b][c] = max(dp[a][b][c], dp[a][b][c-1])

for _ in range(M):
    x, y, z = map(int,input().split())
    print(dp[x][y][z])

Submission Info

Submission Time
Task C - Optimal Recommendations
User kuruton456
Language Python (3.8.2)
Score 0
Code Size 635 Byte
Status WA
Exec Time 1743 ms
Memory 19588 KB

Judge Result

Set Name All
Score / Max Score 0 / 100
Status
AC × 9
WA × 15
Set Name Test Cases
All 10-random-00.txt, 10-random-01.txt, 10-random-02.txt, 10-random-03.txt, 10-random-04.txt, 20-absW-00.txt, 20-absW-01.txt, 20-absW-02.txt, 20-absW-03.txt, 20-absW-04.txt, 30-balance-00.txt, 30-balance-01.txt, 30-balance-02.txt, 30-balance-03.txt, 30-balance-04.txt, 40-limit_dim-00.txt, 40-limit_dim-01.txt, 40-limit_dim-02.txt, 40-limit_dim-03.txt, 40-limit_dim-04.txt, 40-limit_dim-05.txt, 40-limit_dim-06.txt, Corner1.txt, Sample1.txt
Case Name Status Exec Time Memory
10-random-00.txt WA 1709 ms 19580 KB
10-random-01.txt AC 1314 ms 17960 KB
10-random-02.txt WA 1471 ms 18152 KB
10-random-03.txt WA 1574 ms 18568 KB
10-random-04.txt WA 1465 ms 19304 KB
20-absW-00.txt WA 1636 ms 18108 KB
20-absW-01.txt AC 1349 ms 17996 KB
20-absW-02.txt WA 1503 ms 17944 KB
20-absW-03.txt WA 1647 ms 18040 KB
20-absW-04.txt WA 1420 ms 17976 KB
30-balance-00.txt WA 1695 ms 19588 KB
30-balance-01.txt AC 1338 ms 18180 KB
30-balance-02.txt WA 1466 ms 18132 KB
30-balance-03.txt WA 1496 ms 19568 KB
30-balance-04.txt WA 1549 ms 18252 KB
40-limit_dim-00.txt AC 1654 ms 17976 KB
40-limit_dim-01.txt AC 1623 ms 17976 KB
40-limit_dim-02.txt AC 1636 ms 18016 KB
40-limit_dim-03.txt AC 1735 ms 18540 KB
40-limit_dim-04.txt WA 1682 ms 18172 KB
40-limit_dim-05.txt WA 1743 ms 18396 KB
40-limit_dim-06.txt WA 1657 ms 18504 KB
Corner1.txt AC 1379 ms 17960 KB
Sample1.txt AC 1325 ms 18156 KB