結果

問題 No.1570 Blocks
ユーザー maguroflymagurofly
提出日時 2021-06-27 13:24:24
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 216 bytes
コンパイル時間 224 ms
コンパイル使用メモリ 11,392 KB
実行使用メモリ 25,288 KB
最終ジャッジ日時 2023-09-07 17:35:31
合計ジャッジ時間 12,102 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
15,156 KB
testcase_01 AC 78 ms
15,136 KB
testcase_02 AC 215 ms
21,648 KB
testcase_03 WA -
testcase_04 AC 197 ms
21,416 KB
testcase_05 AC 206 ms
21,452 KB
testcase_06 WA -
testcase_07 AC 99 ms
15,804 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 239 ms
22,100 KB
testcase_11 AC 253 ms
23,544 KB
testcase_12 WA -
testcase_13 AC 283 ms
24,724 KB
testcase_14 AC 285 ms
24,988 KB
testcase_15 AC 167 ms
19,272 KB
testcase_16 AC 281 ms
24,864 KB
testcase_17 WA -
testcase_18 AC 248 ms
22,464 KB
testcase_19 WA -
testcase_20 AC 170 ms
19,408 KB
testcase_21 WA -
testcase_22 AC 79 ms
15,248 KB
testcase_23 AC 80 ms
15,304 KB
testcase_24 AC 80 ms
15,176 KB
testcase_25 AC 80 ms
15,352 KB
testcase_26 AC 79 ms
15,048 KB
testcase_27 AC 81 ms
15,140 KB
testcase_28 AC 80 ms
15,372 KB
testcase_29 AC 80 ms
15,144 KB
testcase_30 AC 79 ms
15,268 KB
testcase_31 AC 81 ms
15,300 KB
testcase_32 AC 276 ms
23,796 KB
testcase_33 WA -
testcase_34 AC 270 ms
24,488 KB
testcase_35 WA -
testcase_36 AC 271 ms
24,664 KB
testcase_37 WA -
testcase_38 WA -
testcase_39 AC 283 ms
24,732 KB
testcase_40 AC 269 ms
24,632 KB
testcase_41 WA -
testcase_42 AC 283 ms
25,152 KB
testcase_43 AC 282 ms
25,064 KB
testcase_44 AC 283 ms
25,260 KB
testcase_45 AC 290 ms
25,288 KB
testcase_46 AC 292 ms
23,844 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = gets.to_i
blocks = Array.new(N) { gets.split.map(&:to_i) }
blocks.sort_by { |a, b| b * 10**9 + a }

sum = 0
blocks.each do |a, b|
    if sum > b
        puts "No"
        exit
    end
    sum += a
end

puts "Yes"
0