結果

問題 No.1570 Blocks
ユーザー tamatotamato
提出日時 2021-08-06 08:27:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 217 ms / 2,000 ms
コード長 459 bytes
コンパイル時間 628 ms
コンパイル使用メモリ 87,684 KB
実行使用メモリ 83,376 KB
最終ジャッジ日時 2023-10-15 03:34:20
合計ジャッジ時間 13,568 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
71,332 KB
testcase_01 AC 78 ms
71,572 KB
testcase_02 AC 195 ms
83,376 KB
testcase_03 AC 192 ms
82,208 KB
testcase_04 AC 154 ms
80,600 KB
testcase_05 AC 158 ms
80,964 KB
testcase_06 AC 162 ms
80,924 KB
testcase_07 AC 92 ms
76,336 KB
testcase_08 AC 186 ms
82,376 KB
testcase_09 AC 208 ms
82,120 KB
testcase_10 AC 181 ms
81,364 KB
testcase_11 AC 190 ms
81,912 KB
testcase_12 AC 212 ms
82,304 KB
testcase_13 AC 205 ms
82,620 KB
testcase_14 AC 215 ms
82,368 KB
testcase_15 AC 135 ms
79,112 KB
testcase_16 AC 210 ms
82,172 KB
testcase_17 AC 133 ms
79,176 KB
testcase_18 AC 185 ms
81,896 KB
testcase_19 AC 131 ms
79,180 KB
testcase_20 AC 132 ms
79,260 KB
testcase_21 AC 183 ms
82,476 KB
testcase_22 AC 78 ms
71,336 KB
testcase_23 AC 77 ms
71,548 KB
testcase_24 AC 77 ms
71,080 KB
testcase_25 AC 78 ms
71,484 KB
testcase_26 AC 79 ms
71,360 KB
testcase_27 AC 77 ms
71,572 KB
testcase_28 AC 76 ms
71,368 KB
testcase_29 AC 76 ms
71,436 KB
testcase_30 AC 81 ms
71,332 KB
testcase_31 AC 78 ms
71,240 KB
testcase_32 AC 205 ms
82,496 KB
testcase_33 AC 209 ms
82,264 KB
testcase_34 AC 197 ms
81,824 KB
testcase_35 AC 207 ms
82,096 KB
testcase_36 AC 209 ms
82,084 KB
testcase_37 AC 204 ms
82,192 KB
testcase_38 AC 204 ms
82,204 KB
testcase_39 AC 212 ms
82,624 KB
testcase_40 AC 206 ms
82,148 KB
testcase_41 AC 208 ms
81,956 KB
testcase_42 AC 211 ms
82,200 KB
testcase_43 AC 214 ms
82,632 KB
testcase_44 AC 217 ms
82,164 KB
testcase_45 AC 215 ms
82,636 KB
testcase_46 AC 212 ms
82,196 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    N = int(input())
    C = []
    for _ in range(N):
        a, b = map(int, input().split())
        C.append((a, a + b))
    C.sort(key=lambda x: x[1])
    W = 0
    ok = 1
    for a, b in C:
        W += a
        if W > b:
            ok = 0
            break
    if ok:
        print("Yes")
    else:
        print("No")


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