Submission #16506357


Source Code Expand

Copy
n, m = map(int, input().split())
jobs = [list(map(int, input().split())) for _ in range(n)]
seekers = [list(map(int, input().split())) for _ in range(m)]

dp = [[[0 for _ in range(102)] for i in range(102)] for j in range(102)]

for a, b, c, w in jobs:
    dp[a][b][c] = w

for i in range(101):
    for j in range(101):
        for k in range(101):
            dp[i+1][j][k] = max(dp[i][j][k], dp[i+1][j][k])
            dp[i][j+1][k] = max(dp[i][j][k], dp[i][j+1][k])
            dp[i][j][k+1] = max(dp[i][j][k], dp[i][j][k+1])

for a, b, c in seekers:
    print(dp[a][b][c])

Submission Info

Submission Time
Task C - Optimal Recommendations
User keroido
Language Python (3.8.2)
Score 0
Code Size 593 Byte
Status WA
Exec Time 1704 ms
Memory 32636 KB

Judge Result

Set Name All
Score / Max Score 0 / 100
Status
AC × 10
WA × 14
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 1627 ms 32572 KB
10-random-01.txt AC 1361 ms 18332 KB
10-random-02.txt AC 1392 ms 22880 KB
10-random-03.txt WA 1550 ms 25824 KB
10-random-04.txt WA 1447 ms 25436 KB
20-absW-00.txt AC 1677 ms 31128 KB
20-absW-01.txt AC 1351 ms 18200 KB
20-absW-02.txt AC 1476 ms 26536 KB
20-absW-03.txt AC 1493 ms 27204 KB
20-absW-04.txt AC 1398 ms 21832 KB
30-balance-00.txt WA 1557 ms 32636 KB
30-balance-01.txt AC 1401 ms 18340 KB
30-balance-02.txt AC 1403 ms 20736 KB
30-balance-03.txt WA 1478 ms 28672 KB
30-balance-04.txt WA 1434 ms 24768 KB
40-limit_dim-00.txt WA 1649 ms 32588 KB
40-limit_dim-01.txt WA 1573 ms 32576 KB
40-limit_dim-02.txt WA 1586 ms 32440 KB
40-limit_dim-03.txt WA 1616 ms 32448 KB
40-limit_dim-04.txt WA 1547 ms 32624 KB
40-limit_dim-05.txt WA 1704 ms 32444 KB
40-limit_dim-06.txt WA 1535 ms 32460 KB
Corner1.txt WA 1333 ms 18052 KB
Sample1.txt AC 1401 ms 18324 KB