結果
問題 |
No.710 チーム戦
|
ユーザー |
|
提出日時 | 2022-11-11 14:55:10 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 199 ms / 3,000 ms |
コード長 | 395 bytes |
コンパイル時間 | 344 ms |
コンパイル使用メモリ | 82,152 KB |
実行使用メモリ | 145,064 KB |
最終ジャッジ日時 | 2024-09-13 10:36:49 |
合計ジャッジ時間 | 5,798 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 25 |
ソースコード
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)