結果

問題 No.54 Happy Hallowe'en
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2022-01-01 14:47:20
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 319 bytes
コンパイル時間 170 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 77,568 KB
最終ジャッジ日時 2024-04-18 11:35:05
合計ジャッジ時間 1,895 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
57,600 KB
testcase_01 AC 41 ms
57,984 KB
testcase_02 AC 38 ms
57,856 KB
testcase_03 WA -
testcase_04 AC 67 ms
74,240 KB
testcase_05 AC 69 ms
76,972 KB
testcase_06 AC 75 ms
77,056 KB
testcase_07 AC 79 ms
77,440 KB
testcase_08 AC 84 ms
77,440 KB
testcase_09 AC 80 ms
77,568 KB
testcase_10 AC 36 ms
57,472 KB
testcase_11 AC 37 ms
58,496 KB
testcase_12 AC 74 ms
77,184 KB
testcase_13 AC 78 ms
77,372 KB
testcase_14 AC 39 ms
57,856 KB
testcase_15 AC 37 ms
57,984 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
VT = [list(map(int,input().split())) for i in range(n)]
VT.sort(key=lambda x: x[0]+x[1])

dp = [0]*(2*10**4+5)
dp[0] = 1
for v,t in VT:
    for i in range(t)[::-1]:
        if dp[i]:
            dp[i+v] = 1
            break

ans = 0
for i in range(2*10**4+5):
    if dp[i]:
        ans = i
print(ans)
0