結果
問題 | No.1570 Blocks |
ユーザー |
![]() |
提出日時 | 2021-10-14 10:30:47 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 264 bytes |
コンパイル時間 | 170 ms |
コンパイル使用メモリ | 82,184 KB |
実行使用メモリ | 86,984 KB |
最終ジャッジ日時 | 2024-09-17 16:30:51 |
合計ジャッジ時間 | 13,480 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 |
other | WA * 45 |
ソースコード
n = int(input())total = 0AB = []for i in range(n):a, b = map(int, input().split())AB.append((a, b))total += aAB.sort(key=lambda x:(-x[1], -x[0]))for a, b in AB:if b < total-a:print('NO')exit()total -= aprint('YES')