結果

問題 No.710 チーム戦
ユーザー NoneNone
提出日時 2021-10-11 15:36:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 124 ms / 3,000 ms
コード長 299 bytes
コンパイル時間 1,745 ms
コンパイル使用メモリ 86,888 KB
実行使用メモリ 76,960 KB
最終ジャッジ日時 2023-10-13 17:41:32
合計ジャッジ時間 5,647 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
76,616 KB
testcase_01 AC 72 ms
76,460 KB
testcase_02 AC 119 ms
76,436 KB
testcase_03 AC 118 ms
76,960 KB
testcase_04 AC 120 ms
76,896 KB
testcase_05 AC 116 ms
76,536 KB
testcase_06 AC 118 ms
76,788 KB
testcase_07 AC 120 ms
76,672 KB
testcase_08 AC 121 ms
76,792 KB
testcase_09 AC 122 ms
76,772 KB
testcase_10 AC 116 ms
76,744 KB
testcase_11 AC 121 ms
76,748 KB
testcase_12 AC 121 ms
76,808 KB
testcase_13 AC 121 ms
76,540 KB
testcase_14 AC 121 ms
76,824 KB
testcase_15 AC 124 ms
76,648 KB
testcase_16 AC 121 ms
76,712 KB
testcase_17 AC 122 ms
76,708 KB
testcase_18 AC 123 ms
76,608 KB
testcase_19 AC 123 ms
76,764 KB
testcase_20 AC 119 ms
76,716 KB
testcase_21 AC 120 ms
76,808 KB
testcase_22 AC 101 ms
76,696 KB
testcase_23 AC 100 ms
76,428 KB
testcase_24 AC 120 ms
76,532 KB
testcase_25 AC 70 ms
76,368 KB
testcase_26 AC 68 ms
76,560 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
L=100000
INF=10**9
dp=[INF]*(L+10**3+10)
dp[0]=0
for _ in range(N):
    a,b=map(int, input().split())
    for w in range(L+1)[::-1]:
        if dp[w]<INF:
            dp[w+a]=min(dp[w],dp[w+a])
            dp[w]+=b
res=INF
for w in range(L+1):
    res=min(res,max(w,dp[w]))
print(res)
0