結果

問題 No.274 The Wall
ユーザー TANIGUCHI KousukeTANIGUCHI Kousuke
提出日時 2015-09-01 13:07:43
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 252 bytes
コンパイル時間 319 ms
コンパイル使用メモリ 11,368 KB
実行使用メモリ 15,452 KB
最終ジャッジ日時 2023-09-25 21:45:17
合計ジャッジ時間 4,769 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 84 ms
15,168 KB
testcase_04 WA -
testcase_05 AC 84 ms
15,124 KB
testcase_06 WA -
testcase_07 AC 83 ms
15,140 KB
testcase_08 AC 82 ms
15,124 KB
testcase_09 WA -
testcase_10 AC 83 ms
15,136 KB
testcase_11 WA -
testcase_12 AC 91 ms
15,292 KB
testcase_13 AC 87 ms
15,060 KB
testcase_14 AC 86 ms
15,024 KB
testcase_15 AC 87 ms
15,128 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 226 ms
15,256 KB
testcase_19 AC 88 ms
15,380 KB
testcase_20 AC 91 ms
15,192 KB
testcase_21 AC 89 ms
15,392 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 87 ms
15,448 KB
testcase_25 AC 88 ms
15,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n,m = gets.split.map(&:to_i)

wall = Array.new(m,0)
lines = n.times.map { |i| gets.split.map(&:to_i) }

lines.each do |(l,r)| 
    (l..r).each do |i|
        wall[i] += 1
        wall[m-i-1] += 1
    end
end

puts wall.find {|v| v <= 2} ? "YES" : "NO"
0