結果

問題 No.710 チーム戦
ユーザー convexineqconvexineq
提出日時 2021-03-18 17:18:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 128 ms / 3,000 ms
コード長 277 bytes
コンパイル時間 224 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 65,536 KB
最終ジャッジ日時 2024-04-28 07:11:53
合計ジャッジ時間 4,144 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
59,392 KB
testcase_01 AC 55 ms
61,056 KB
testcase_02 AC 110 ms
64,128 KB
testcase_03 AC 123 ms
64,640 KB
testcase_04 AC 122 ms
63,616 KB
testcase_05 AC 114 ms
64,512 KB
testcase_06 AC 116 ms
64,896 KB
testcase_07 AC 115 ms
64,640 KB
testcase_08 AC 115 ms
64,256 KB
testcase_09 AC 117 ms
64,512 KB
testcase_10 AC 113 ms
64,256 KB
testcase_11 AC 109 ms
64,256 KB
testcase_12 AC 115 ms
64,384 KB
testcase_13 AC 116 ms
64,256 KB
testcase_14 AC 115 ms
64,000 KB
testcase_15 AC 116 ms
65,024 KB
testcase_16 AC 116 ms
64,512 KB
testcase_17 AC 120 ms
63,744 KB
testcase_18 AC 116 ms
65,152 KB
testcase_19 AC 114 ms
64,640 KB
testcase_20 AC 118 ms
64,256 KB
testcase_21 AC 116 ms
64,640 KB
testcase_22 AC 104 ms
63,104 KB
testcase_23 AC 99 ms
61,824 KB
testcase_24 AC 128 ms
65,536 KB
testcase_25 AC 42 ms
51,968 KB
testcase_26 AC 43 ms
52,608 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
M = 1<<30
INF = N = n*1000+1
dp = [INF]*N
dp[0] = 0
for _ in range(n):
    a,b = map(int,input().split())
    for i in range(N)[::-1]:
        dp[i] = min(dp[i]+b,dp[i-a] if i >= a else INF)
ans = N
for i in range(N):
    ans = min(ans,max(i,dp[i]))
print(ans)
0