結果

問題 No.1570 Blocks
ユーザー ygd.ygd.
提出日時 2021-06-29 18:48:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 259 ms / 2,000 ms
コード長 356 bytes
コンパイル時間 384 ms
コンパイル使用メモリ 86,952 KB
実行使用メモリ 87,508 KB
最終ジャッジ日時 2023-09-08 03:55:41
合計ジャッジ時間 11,153 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,324 KB
testcase_01 AC 70 ms
71,464 KB
testcase_02 AC 183 ms
81,668 KB
testcase_03 AC 212 ms
82,348 KB
testcase_04 AC 171 ms
81,028 KB
testcase_05 AC 176 ms
81,060 KB
testcase_06 AC 183 ms
80,472 KB
testcase_07 AC 105 ms
77,804 KB
testcase_08 AC 209 ms
82,452 KB
testcase_09 AC 229 ms
82,880 KB
testcase_10 AC 204 ms
81,932 KB
testcase_11 AC 213 ms
82,020 KB
testcase_12 AC 235 ms
82,788 KB
testcase_13 AC 237 ms
82,944 KB
testcase_14 AC 252 ms
86,580 KB
testcase_15 AC 154 ms
80,336 KB
testcase_16 AC 250 ms
87,508 KB
testcase_17 AC 151 ms
80,596 KB
testcase_18 AC 206 ms
81,776 KB
testcase_19 AC 150 ms
80,840 KB
testcase_20 AC 149 ms
80,316 KB
testcase_21 AC 203 ms
83,656 KB
testcase_22 AC 69 ms
71,492 KB
testcase_23 AC 69 ms
71,532 KB
testcase_24 AC 69 ms
71,568 KB
testcase_25 AC 70 ms
71,448 KB
testcase_26 AC 71 ms
71,452 KB
testcase_27 AC 70 ms
71,392 KB
testcase_28 AC 72 ms
71,468 KB
testcase_29 AC 71 ms
71,168 KB
testcase_30 AC 71 ms
71,512 KB
testcase_31 AC 71 ms
71,468 KB
testcase_32 AC 230 ms
82,692 KB
testcase_33 AC 236 ms
82,476 KB
testcase_34 AC 226 ms
82,152 KB
testcase_35 AC 233 ms
82,576 KB
testcase_36 AC 229 ms
82,728 KB
testcase_37 AC 228 ms
82,448 KB
testcase_38 AC 230 ms
82,580 KB
testcase_39 AC 252 ms
87,100 KB
testcase_40 AC 228 ms
83,164 KB
testcase_41 AC 233 ms
82,712 KB
testcase_42 AC 259 ms
84,704 KB
testcase_43 AC 255 ms
84,692 KB
testcase_44 AC 255 ms
84,676 KB
testcase_45 AC 256 ms
84,764 KB
testcase_46 AC 235 ms
82,528 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    N = int(input())
    Z = []
    for i in range(N):
        a,b = map(int,input().split())
        Z.append((a,b))
    Z.sort(key = lambda x: x[0] + x[1])
    #print(Z)

    w = 0
    for i in range(N):
        a,b = Z[i]
        if w > b:
            print("No");exit()
        w += a
    print("Yes")

if __name__ == '__main__':
    main()
0