結果

問題 No.54 Happy Hallowe'en
ユーザー dangodango
提出日時 2023-07-09 16:25:04
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 337 bytes
コンパイル時間 690 ms
コンパイル使用メモリ 87,256 KB
実行使用メモリ 147,572 KB
最終ジャッジ日時 2023-09-30 19:48:05
合計ジャッジ時間 16,500 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,396 KB
testcase_01 AC 72 ms
71,280 KB
testcase_02 AC 72 ms
71,284 KB
testcase_03 WA -
testcase_04 AC 449 ms
83,160 KB
testcase_05 AC 691 ms
89,268 KB
testcase_06 WA -
testcase_07 AC 1,538 ms
112,248 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 74 ms
71,084 KB
testcase_11 AC 73 ms
71,348 KB
testcase_12 AC 2,703 ms
144,300 KB
testcase_13 AC 2,618 ms
145,956 KB
testcase_14 AC 74 ms
71,340 KB
testcase_15 AC 74 ms
71,088 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
k = []
for n in range(N):
    a, b = map(int, input().split())
    k.append((a, b))
k.sort(key=lambda it: it[0] + it[1])
s = set()
for ik in k:
    s2 = set()
    for i in s:
        if i >= ik[1]:
            break
        else:
            s2.add(i + ik[0])
    s2.add(ik[0])
    s |= s2
ans = list(s)
print(max(ans))
0