結果

問題 No.54 Happy Hallowe'en
ユーザー convexineqconvexineq
提出日時 2020-12-11 08:34:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 111 ms / 5,000 ms
コード長 163 bytes
コンパイル時間 783 ms
コンパイル使用メモリ 81,580 KB
実行使用メモリ 77,076 KB
最終ジャッジ日時 2023-10-20 01:21:31
合計ジャッジ時間 3,281 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,368 KB
testcase_01 AC 39 ms
53,368 KB
testcase_02 AC 39 ms
53,368 KB
testcase_03 AC 39 ms
53,368 KB
testcase_04 AC 85 ms
76,160 KB
testcase_05 AC 89 ms
76,388 KB
testcase_06 AC 92 ms
76,604 KB
testcase_07 AC 98 ms
76,772 KB
testcase_08 AC 105 ms
76,916 KB
testcase_09 AC 111 ms
77,072 KB
testcase_10 AC 37 ms
53,384 KB
testcase_11 AC 38 ms
53,384 KB
testcase_12 AC 98 ms
77,072 KB
testcase_13 AC 103 ms
77,076 KB
testcase_14 AC 37 ms
53,384 KB
testcase_15 AC 38 ms
53,384 KB
testcase_16 AC 38 ms
53,384 KB
testcase_17 AC 38 ms
53,384 KB
testcase_18 AC 39 ms
53,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
vt = [list(map(int,input().split())) for _ in range(n)]
vt.sort(key=sum)
dp = 1
for v,t in vt:
    dp |= (dp&(1<<t)-1)<<v
print(dp.bit_length()-1)
0