結果
| 問題 |
No.54 Happy Hallowe'en
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-01-01 14:48:13 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 432 ms / 5,000 ms |
| コード長 | 302 bytes |
| コンパイル時間 | 147 ms |
| コンパイル使用メモリ | 81,964 KB |
| 実行使用メモリ | 77,680 KB |
| 最終ジャッジ日時 | 2024-10-10 04:47:20 |
| 合計ジャッジ時間 | 3,301 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 |
ソースコード
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
ans = 0
for i in range(2*10**4+5):
if dp[i]:
ans = i
print(ans)