結果

問題 No.274 The Wall
ユーザー yuruhiyayuruhiya
提出日時 2020-05-15 16:14:49
言語 Crystal
(1.11.2)
結果
WA  
実行時間 -
コード長 230 bytes
コンパイル時間 17,807 ms
コンパイル使用メモリ 253,080 KB
実行使用メモリ 4,940 KB
最終ジャッジ日時 2023-09-13 10:37:28
合計ジャッジ時間 19,189 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 3 ms
4,376 KB
testcase_02 AC 2 ms
4,488 KB
testcase_03 AC 3 ms
4,608 KB
testcase_04 AC 3 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 3 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 3 ms
4,376 KB
testcase_10 AC 3 ms
4,488 KB
testcase_11 AC 18 ms
4,764 KB
testcase_12 AC 4 ms
4,848 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 3 ms
4,640 KB
testcase_16 AC 8 ms
4,824 KB
testcase_17 AC 6 ms
4,804 KB
testcase_18 AC 7 ms
4,744 KB
testcase_19 WA -
testcase_20 AC 3 ms
4,824 KB
testcase_21 WA -
testcase_22 AC 3 ms
4,772 KB
testcase_23 AC 4 ms
4,880 KB
testcase_24 AC 3 ms
4,940 KB
testcase_25 AC 3 ms
4,896 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = read_line.split.map &.to_i
cnt = [0] * (m.succ // 2)
n.times do
  l, r = read_line.split.map &.to_i
  (l..r).each do |i|
    cnt[i < cnt.size ? i : cnt.size - i - 1] += 1
  end
end
puts cnt.all? {|i| i <= 2 } ? "YES" : "NO"
0