QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#523973 | #8768. Arrested Development | wuxman57 | Compile Error | / | / | Python3 | 470b | 2024-08-19 03:10:08 | 2024-08-19 03:10:08 |
Judging History
answer
n = int(input())
a = [0] * n
b = [0] * n
maxval = 0
for x in range(0, n);
line = [int(i) for i in input().split(" ")]
a[x] = line[0]
b[x] = line[1]
maxval += a[x]
dp = [float("inf")] * (maxval + 1)
dp[0] = 0
for x in range(0, n):
for y in range(maxval, -1, -1):
dp[y] += b[x]
if y >= a[x]:
dp[y] = min(dp[y], dp[y - a[x]])
ans = float("inf")
for x in range(0, maxval + 1):
ans = min(ans, max(x, dp[x]))
print(ans)
Details
File "answer.code", line 8 for x in range(0, n); ^ SyntaxError: invalid syntax