結果

問題 No.1583 Building Blocks
ユーザー convexineqconvexineq
提出日時 2021-07-03 05:50:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 108 ms / 2,000 ms
コード長 257 bytes
コンパイル時間 323 ms
コンパイル使用メモリ 87,116 KB
実行使用メモリ 76,804 KB
最終ジャッジ日時 2023-10-12 03:05:01
合計ジャッジ時間 6,103 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,384 KB
testcase_01 AC 68 ms
71,148 KB
testcase_02 AC 69 ms
71,108 KB
testcase_03 AC 88 ms
76,508 KB
testcase_04 AC 75 ms
75,900 KB
testcase_05 AC 75 ms
75,844 KB
testcase_06 AC 84 ms
76,288 KB
testcase_07 AC 94 ms
76,532 KB
testcase_08 AC 81 ms
75,852 KB
testcase_09 AC 102 ms
76,744 KB
testcase_10 AC 83 ms
75,960 KB
testcase_11 AC 77 ms
71,304 KB
testcase_12 AC 98 ms
76,224 KB
testcase_13 AC 101 ms
76,620 KB
testcase_14 AC 90 ms
76,024 KB
testcase_15 AC 94 ms
76,688 KB
testcase_16 AC 98 ms
76,720 KB
testcase_17 AC 99 ms
76,716 KB
testcase_18 AC 87 ms
76,160 KB
testcase_19 AC 108 ms
76,804 KB
testcase_20 AC 88 ms
76,240 KB
testcase_21 AC 92 ms
76,548 KB
testcase_22 AC 90 ms
76,320 KB
testcase_23 AC 85 ms
75,884 KB
testcase_24 AC 99 ms
76,612 KB
testcase_25 AC 72 ms
71,472 KB
testcase_26 AC 105 ms
76,612 KB
testcase_27 AC 91 ms
76,516 KB
testcase_28 AC 104 ms
76,724 KB
testcase_29 AC 87 ms
76,404 KB
testcase_30 AC 83 ms
75,976 KB
testcase_31 AC 97 ms
76,688 KB
testcase_32 AC 87 ms
76,312 KB
testcase_33 AC 102 ms
76,764 KB
testcase_34 AC 73 ms
71,472 KB
testcase_35 AC 87 ms
76,452 KB
testcase_36 AC 100 ms
76,612 KB
testcase_37 AC 86 ms
76,444 KB
testcase_38 AC 75 ms
71,500 KB
testcase_39 AC 76 ms
71,536 KB
testcase_40 AC 74 ms
71,564 KB
testcase_41 AC 75 ms
71,604 KB
testcase_42 AC 75 ms
71,300 KB
testcase_43 AC 74 ms
71,388 KB
testcase_44 AC 78 ms
71,524 KB
testcase_45 AC 76 ms
71,484 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
ws = [list(map(int,input().split())) for i in range(n)]
ws.sort(key=sum)
INF = 1<<60
dp = [INF]*(n+1)
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+[INF]).index(INF)-1)
0