結果

問題 No.1570 Blocks
ユーザー NatsubiSoganNatsubiSogan
提出日時 2021-06-27 13:30:33
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 395 bytes
コンパイル時間 344 ms
コンパイル使用メモリ 87,052 KB
実行使用メモリ 94,032 KB
最終ジャッジ日時 2023-09-07 17:37:42
合計ジャッジ時間 15,670 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,428 KB
testcase_01 AC 72 ms
71,472 KB
testcase_02 AC 301 ms
88,256 KB
testcase_03 AC 368 ms
91,372 KB
testcase_04 AC 263 ms
86,952 KB
testcase_05 AC 276 ms
87,588 KB
testcase_06 AC 288 ms
87,644 KB
testcase_07 AC 117 ms
77,956 KB
testcase_08 AC 348 ms
90,716 KB
testcase_09 AC 399 ms
93,016 KB
testcase_10 AC 330 ms
90,008 KB
testcase_11 AC 354 ms
91,164 KB
testcase_12 AC 408 ms
93,636 KB
testcase_13 AC 398 ms
93,360 KB
testcase_14 AC 413 ms
93,648 KB
testcase_15 AC 222 ms
84,508 KB
testcase_16 AC 406 ms
93,416 KB
testcase_17 AC 218 ms
84,028 KB
testcase_18 AC 342 ms
90,316 KB
testcase_19 AC 217 ms
84,056 KB
testcase_20 AC 223 ms
84,376 KB
testcase_21 AC 330 ms
89,332 KB
testcase_22 AC 72 ms
71,292 KB
testcase_23 AC 72 ms
71,144 KB
testcase_24 AC 73 ms
71,312 KB
testcase_25 AC 74 ms
71,404 KB
testcase_26 AC 73 ms
71,292 KB
testcase_27 AC 71 ms
71,308 KB
testcase_28 AC 76 ms
71,276 KB
testcase_29 AC 72 ms
71,348 KB
testcase_30 AC 72 ms
71,276 KB
testcase_31 AC 71 ms
71,448 KB
testcase_32 AC 398 ms
93,496 KB
testcase_33 AC 416 ms
93,624 KB
testcase_34 AC 393 ms
92,224 KB
testcase_35 AC 415 ms
93,420 KB
testcase_36 AC 400 ms
92,888 KB
testcase_37 AC 397 ms
92,660 KB
testcase_38 WA -
testcase_39 AC 411 ms
93,756 KB
testcase_40 AC 394 ms
92,984 KB
testcase_41 AC 415 ms
93,472 KB
testcase_42 AC 421 ms
93,860 KB
testcase_43 AC 425 ms
94,032 KB
testcase_44 AC 416 ms
94,028 KB
testcase_45 AC 430 ms
93,920 KB
testcase_46 AC 420 ms
93,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations

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[1], x[0]))
if n <= 9:
    for p in permutations(ab, n):
        ok(list(p))

ok(ab)
print("No")
0