結果

問題 No.1583 Building Blocks
ユーザー convexineqconvexineq
提出日時 2021-07-03 05:53:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 109 ms / 2,000 ms
コード長 249 bytes
コンパイル時間 551 ms
コンパイル使用メモリ 86,836 KB
実行使用メモリ 76,772 KB
最終ジャッジ日時 2023-10-12 03:05:02
合計ジャッジ時間 6,317 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,200 KB
testcase_01 AC 77 ms
71,348 KB
testcase_02 AC 77 ms
71,316 KB
testcase_03 AC 97 ms
76,288 KB
testcase_04 AC 84 ms
75,664 KB
testcase_05 AC 83 ms
75,740 KB
testcase_06 AC 92 ms
76,440 KB
testcase_07 AC 93 ms
76,476 KB
testcase_08 AC 84 ms
75,664 KB
testcase_09 AC 105 ms
76,772 KB
testcase_10 AC 83 ms
75,484 KB
testcase_11 AC 79 ms
71,400 KB
testcase_12 AC 100 ms
76,404 KB
testcase_13 AC 105 ms
76,680 KB
testcase_14 AC 93 ms
76,336 KB
testcase_15 AC 98 ms
76,228 KB
testcase_16 AC 102 ms
76,656 KB
testcase_17 AC 101 ms
76,500 KB
testcase_18 AC 88 ms
76,016 KB
testcase_19 AC 109 ms
76,616 KB
testcase_20 AC 93 ms
76,360 KB
testcase_21 AC 92 ms
76,376 KB
testcase_22 AC 94 ms
76,256 KB
testcase_23 AC 87 ms
75,896 KB
testcase_24 AC 102 ms
76,516 KB
testcase_25 AC 77 ms
71,256 KB
testcase_26 AC 105 ms
76,508 KB
testcase_27 AC 93 ms
76,216 KB
testcase_28 AC 107 ms
76,684 KB
testcase_29 AC 92 ms
76,380 KB
testcase_30 AC 87 ms
75,796 KB
testcase_31 AC 99 ms
76,464 KB
testcase_32 AC 92 ms
76,492 KB
testcase_33 AC 106 ms
76,524 KB
testcase_34 AC 77 ms
71,300 KB
testcase_35 AC 93 ms
76,284 KB
testcase_36 AC 101 ms
76,508 KB
testcase_37 AC 85 ms
76,296 KB
testcase_38 AC 77 ms
71,340 KB
testcase_39 AC 77 ms
71,448 KB
testcase_40 AC 77 ms
71,196 KB
testcase_41 AC 76 ms
71,444 KB
testcase_42 AC 76 ms
71,192 KB
testcase_43 AC 78 ms
71,064 KB
testcase_44 AC 77 ms
71,340 KB
testcase_45 AC 77 ms
71,268 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
ws = sorted((list(map(int,input().split())) for i in range(n)), key=sum)
INF = 1<<60
dp = [INF]*(n+2)
dp[0] = 0
for w,s in ws:
    for i in range(n)[::-1]:
        if dp[i] <= s: dp[i+1] = min(dp[i+1],dp[i]+w)
print(dp.index(INF)-1)
0