結果
問題 | No.54 Happy Hallowe'en |
ユーザー |
|
提出日時 | 2022-01-24 20:28:13 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 457 bytes |
コンパイル時間 | 501 ms |
コンパイル使用メモリ | 82,264 KB |
実行使用メモリ | 78,072 KB |
最終ジャッジ日時 | 2024-12-14 22:32:40 |
合計ジャッジ時間 | 2,732 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 RE * 13 |
ソースコード
import sysdef 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] * 2000for v, t in VT:for i in range(t-1, -1, -1):if a[i]:a[i+v] = Truefor i in range(len(a)-1, -1, -1):if a[i]:print(i)returnif __name__ == '__main__':main()