結果

問題 No.1570 Blocks
ユーザー moharan627moharan627
提出日時 2021-06-27 13:48:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 838 bytes
コンパイル時間 72 ms
コンパイル使用メモリ 10,984 KB
実行使用メモリ 30,276 KB
最終ジャッジ日時 2023-09-07 17:42:11
合計ジャッジ時間 9,441 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,240 KB
testcase_01 AC 19 ms
8,408 KB
testcase_02 AC 157 ms
22,644 KB
testcase_03 AC 208 ms
26,380 KB
testcase_04 AC 131 ms
21,020 KB
testcase_05 AC 146 ms
21,588 KB
testcase_06 AC 157 ms
22,100 KB
testcase_07 AC 32 ms
10,244 KB
testcase_08 AC 203 ms
26,020 KB
testcase_09 AC 234 ms
29,036 KB
testcase_10 AC 175 ms
24,692 KB
testcase_11 AC 195 ms
26,520 KB
testcase_12 AC 260 ms
29,628 KB
testcase_13 AC 230 ms
29,488 KB
testcase_14 AC 235 ms
30,004 KB
testcase_15 AC 99 ms
17,764 KB
testcase_16 AC 239 ms
29,616 KB
testcase_17 AC 105 ms
17,344 KB
testcase_18 AC 184 ms
25,528 KB
testcase_19 AC 102 ms
17,380 KB
testcase_20 AC 100 ms
17,632 KB
testcase_21 AC 181 ms
23,892 KB
testcase_22 AC 16 ms
8,260 KB
testcase_23 AC 16 ms
8,220 KB
testcase_24 AC 16 ms
8,308 KB
testcase_25 AC 17 ms
8,252 KB
testcase_26 AC 17 ms
8,312 KB
testcase_27 AC 16 ms
8,376 KB
testcase_28 AC 16 ms
8,340 KB
testcase_29 AC 16 ms
8,392 KB
testcase_30 AC 17 ms
8,340 KB
testcase_31 AC 17 ms
8,356 KB
testcase_32 AC 265 ms
29,408 KB
testcase_33 AC 272 ms
29,784 KB
testcase_34 AC 224 ms
28,060 KB
testcase_35 AC 264 ms
29,168 KB
testcase_36 AC 224 ms
28,800 KB
testcase_37 AC 246 ms
28,224 KB
testcase_38 WA -
testcase_39 AC 238 ms
29,836 KB
testcase_40 AC 230 ms
29,140 KB
testcase_41 AC 264 ms
29,488 KB
testcase_42 AC 243 ms
30,276 KB
testcase_43 AC 244 ms
30,188 KB
testcase_44 AC 247 ms
30,036 KB
testcase_45 AC 244 ms
30,112 KB
testcase_46 AC 266 ms
30,028 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
#sys.setrecursionlimit(10 ** 6)
INF = float('inf')
#10**20に変えるのもあり
MOD = 10**9 + 7
MOD2 = 998244353
def solve():
    def II(): return int(sys.stdin.readline())
    def LI(): return list(map(int, sys.stdin.readline().split()))
    def LC(): return list(input())
    def IC(): return [int(c) for c in input()]
    def MI(): return map(int, sys.stdin.readline().split())
    N = II()
    Block = [0]*N
    Asum = 0
    for n in range(N):
        A,B = MI()
        Block[n] = (A,B)
        Asum += A
    from operator import itemgetter
    Bs = sorted(Block, key = itemgetter(1,0),reverse=True)
    Acum = 0
    #print(Bs)
    for n in range(N):
        a,b = Bs[n]
        Acum += a
        #print(Asum-Acum)
        if(Asum-Acum >b):
            print("No")
            exit()
    print("Yes")
    return
solve()
0