結果

問題 No.1557 Binary Variable
ユーザー yuruhiyayuruhiya
提出日時 2021-06-27 08:46:28
言語 Crystal
(1.11.2)
結果
AC  
実行時間 95 ms / 2,000 ms
コード長 222 bytes
コンパイル時間 20,530 ms
コンパイル使用メモリ 257,100 KB
実行使用メモリ 13,460 KB
最終ジャッジ日時 2023-09-07 15:48:18
合計ジャッジ時間 22,746 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
13,172 KB
testcase_01 AC 64 ms
13,116 KB
testcase_02 AC 2 ms
4,464 KB
testcase_03 AC 3 ms
4,524 KB
testcase_04 AC 68 ms
13,416 KB
testcase_05 AC 69 ms
13,124 KB
testcase_06 AC 68 ms
13,212 KB
testcase_07 AC 67 ms
13,316 KB
testcase_08 AC 74 ms
13,336 KB
testcase_09 AC 78 ms
13,308 KB
testcase_10 AC 84 ms
13,380 KB
testcase_11 AC 86 ms
13,312 KB
testcase_12 AC 75 ms
13,296 KB
testcase_13 AC 86 ms
13,336 KB
testcase_14 AC 90 ms
13,196 KB
testcase_15 AC 86 ms
13,248 KB
testcase_16 AC 89 ms
13,380 KB
testcase_17 AC 90 ms
13,304 KB
testcase_18 AC 89 ms
13,388 KB
testcase_19 AC 93 ms
13,308 KB
testcase_20 AC 92 ms
13,204 KB
testcase_21 AC 92 ms
13,200 KB
testcase_22 AC 91 ms
13,228 KB
testcase_23 AC 91 ms
13,460 KB
testcase_24 AC 94 ms
13,376 KB
testcase_25 AC 94 ms
13,200 KB
testcase_26 AC 93 ms
13,200 KB
testcase_27 AC 93 ms
13,136 KB
testcase_28 AC 94 ms
13,212 KB
testcase_29 AC 94 ms
13,212 KB
testcase_30 AC 94 ms
13,304 KB
testcase_31 AC 94 ms
13,236 KB
testcase_32 AC 95 ms
13,272 KB
testcase_33 AC 91 ms
13,184 KB
testcase_34 AC 3 ms
4,452 KB
testcase_35 AC 3 ms
4,384 KB
testcase_36 AC 3 ms
4,480 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = read_line.split.map(&.to_i)
prev = -1
puts n - (1..m).map {
  {Int32, Int32}.from read_line.split.map(&.to_i)
}.sort_by { |l, r| {r, l} }.count { |l, r|
  if l <= prev
    false
  else
    prev = r
    true
  end
}
0