結果

問題 No.710 チーム戦
ユーザー 👑 rin204rin204
提出日時 2022-11-11 14:55:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 234 ms / 3,000 ms
コード長 395 bytes
コンパイル時間 288 ms
コンパイル使用メモリ 87,124 KB
実行使用メモリ 155,376 KB
最終ジャッジ日時 2023-10-11 11:51:27
合計ジャッジ時間 6,961 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
79,076 KB
testcase_01 AC 87 ms
80,632 KB
testcase_02 AC 231 ms
155,172 KB
testcase_03 AC 226 ms
155,164 KB
testcase_04 AC 232 ms
155,108 KB
testcase_05 AC 225 ms
155,240 KB
testcase_06 AC 227 ms
155,296 KB
testcase_07 AC 226 ms
155,268 KB
testcase_08 AC 228 ms
155,236 KB
testcase_09 AC 226 ms
155,292 KB
testcase_10 AC 225 ms
155,304 KB
testcase_11 AC 226 ms
155,200 KB
testcase_12 AC 225 ms
155,100 KB
testcase_13 AC 225 ms
155,196 KB
testcase_14 AC 228 ms
155,340 KB
testcase_15 AC 225 ms
155,308 KB
testcase_16 AC 227 ms
155,276 KB
testcase_17 AC 225 ms
155,268 KB
testcase_18 AC 227 ms
155,280 KB
testcase_19 AC 229 ms
155,260 KB
testcase_20 AC 226 ms
155,376 KB
testcase_21 AC 234 ms
155,244 KB
testcase_22 AC 222 ms
155,000 KB
testcase_23 AC 217 ms
155,000 KB
testcase_24 AC 228 ms
155,172 KB
testcase_25 AC 79 ms
77,348 KB
testcase_26 AC 80 ms
77,408 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())

inf = 1 << 60
ma = 10 ** 5
dp = [inf] * (ma + 1)
dp[0] = 0
for _ in range(n):
    a, b = map(int, input().split())
    ndp = [inf] * (ma + 1)
    for i in range(a, ma + 1):
        ndp[i] = min(ndp[i], dp[i - a])
    for i in range(ma + 1):
        ndp[i] = min(ndp[i], dp[i] + b)
    dp = ndp

ans = 1 << 60
for i in range(ma + 1):
    ans = min(ans, max(i, dp[i]))
print(ans)
0