結果

問題 No.1570 Blocks
ユーザー NatsubiSogan
提出日時 2021-06-27 13:14:31
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 225 bytes
コンパイル時間 92 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 38,424 KB
最終ジャッジ日時 2024-06-25 11:21:12
合計ジャッジ時間 19,649 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 44 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
ab = [list(map(int, input().split())) for i in range(n)]
ab.sort(key=lambda x:(x[1], x[0]))
s = 0
for i in range(n):
    if s > ab[i][1]:
        exit(print("No"))
    else:
        s += ab[i][0]
print("Yes")
0