結果

問題 No.710 チーム戦
コンテスト
ユーザー 👑 rin204
提出日時 2022-11-11 14:55:10
言語 PyPy3
(8.0.0 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 125 ms / 3,000 ms
+ 755µs
コード長 395 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 939 ms
コンパイル使用メモリ 64,340 KB
実行使用メモリ 89,072 KB
最終ジャッジ日時 2026-10-20 07:33:36
合計ジャッジ時間 5,399 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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