結果
| 問題 |
No.1570 Blocks
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-06-27 14:46:54 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 294 bytes |
| コンパイル時間 | 386 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 35,360 KB |
| 最終ジャッジ日時 | 2024-06-25 11:43:17 |
| 合計ジャッジ時間 | 15,954 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 32 WA * 13 |
ソースコード
def ok(ab):
s = 0
for i in range(n):
if s > ab[i][1]:
break
else:
s += ab[i][0]
else:
exit(print("Yes"))
n = int(input())
ab = [list(map(int, input().split())) for i in range(n)]
ab.sort(key=lambda x: (x[0] - x[1]))
ok(ab)
print("No")