結果
問題 | No.54 Happy Hallowe'en |
ユーザー | 👑 cologne |
提出日時 | 2022-01-24 20:28:13 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 457 bytes |
コンパイル時間 | 339 ms |
コンパイル使用メモリ | 87,088 KB |
実行使用メモリ | 82,552 KB |
最終ジャッジ日時 | 2023-08-21 11:41:27 |
合計ジャッジ時間 | 4,060 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 73 ms
75,280 KB |
testcase_01 | AC | 73 ms
75,204 KB |
testcase_02 | AC | 73 ms
75,000 KB |
testcase_03 | AC | 73 ms
75,296 KB |
testcase_04 | RE | - |
testcase_05 | RE | - |
testcase_06 | RE | - |
testcase_07 | RE | - |
testcase_08 | RE | - |
testcase_09 | RE | - |
testcase_10 | AC | 74 ms
75,012 KB |
testcase_11 | RE | - |
testcase_12 | RE | - |
testcase_13 | RE | - |
testcase_14 | RE | - |
testcase_15 | AC | 73 ms
75,200 KB |
testcase_16 | RE | - |
testcase_17 | RE | - |
testcase_18 | RE | - |
ソースコード
import sys def input(): return sys.stdin.readline().rstrip() def main(): N = int(input()) VT = [list(map(int, input().split())) for i in range(N)] VT.sort(key=sum) a = [True] + [False] * 2000 for v, t in VT: for i in range(t-1, -1, -1): if a[i]: a[i+v] = True for i in range(len(a)-1, -1, -1): if a[i]: print(i) return if __name__ == '__main__': main()