結果
| 問題 | No.1570 Blocks |
| コンテスト | |
| ユーザー |
brthyyjp
|
| 提出日時 | 2021-10-14 10:30:47 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 264 bytes |
| 記録 | |
| コンパイル時間 | 408 ms |
| コンパイル使用メモリ | 95,976 KB |
| 実行使用メモリ | 95,384 KB |
| 最終ジャッジ日時 | 2026-08-29 17:12:50 |
| 合計ジャッジ時間 | 12,411 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 2 |
| other | WA * 45 |
ソースコード
n = int(input())
total = 0
AB = []
for i in range(n):
a, b = map(int, input().split())
AB.append((a, b))
total += a
AB.sort(key=lambda x:(-x[1], -x[0]))
for a, b in AB:
if b < total-a:
print('NO')
exit()
total -= a
print('YES')
brthyyjp