結果

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

ソースコード

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