結果

問題 No.1557 Binary Variable
ユーザー 小野寺健小野寺健
提出日時 2021-10-31 12:22:08
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,043 ms / 2,000 ms
コード長 242 bytes
コンパイル時間 76 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 30,336 KB
最終ジャッジ日時 2024-04-17 05:08:23
合計ジャッジ時間 36,070 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 989 ms
30,080 KB
testcase_01 AC 1,043 ms
28,160 KB
testcase_02 AC 87 ms
12,288 KB
testcase_03 AC 88 ms
12,160 KB
testcase_04 AC 1,025 ms
30,080 KB
testcase_05 AC 1,026 ms
30,336 KB
testcase_06 AC 1,028 ms
30,208 KB
testcase_07 AC 1,025 ms
30,208 KB
testcase_08 AC 1,031 ms
30,080 KB
testcase_09 AC 1,015 ms
30,080 KB
testcase_10 AC 1,007 ms
30,080 KB
testcase_11 AC 1,016 ms
30,208 KB
testcase_12 AC 1,008 ms
30,080 KB
testcase_13 AC 989 ms
30,208 KB
testcase_14 AC 993 ms
30,080 KB
testcase_15 AC 993 ms
30,080 KB
testcase_16 AC 988 ms
30,208 KB
testcase_17 AC 996 ms
30,080 KB
testcase_18 AC 994 ms
30,080 KB
testcase_19 AC 993 ms
27,648 KB
testcase_20 AC 1,002 ms
28,032 KB
testcase_21 AC 1,012 ms
28,160 KB
testcase_22 AC 1,008 ms
27,776 KB
testcase_23 AC 1,009 ms
27,904 KB
testcase_24 AC 1,011 ms
27,776 KB
testcase_25 AC 1,024 ms
27,648 KB
testcase_26 AC 1,001 ms
27,776 KB
testcase_27 AC 985 ms
27,904 KB
testcase_28 AC 993 ms
27,648 KB
testcase_29 AC 1,004 ms
27,776 KB
testcase_30 AC 1,002 ms
27,648 KB
testcase_31 AC 1,000 ms
27,648 KB
testcase_32 AC 1,007 ms
27,904 KB
testcase_33 AC 1,014 ms
28,032 KB
testcase_34 AC 86 ms
12,160 KB
testcase_35 AC 86 ms
12,160 KB
testcase_36 AC 85 ms
12,160 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N, M = gets.split(" ").map{|s| s.to_i}

lr = []
M.times {
	lr << gets.split(" ").map{|s| s.to_i}
}

lr.sort!

maxr = -Float::INFINITY
cnt = N

lr.each {|l, r|
	if l > maxr then
		cnt -= 1
		maxr = r
	elsif r < maxr
		maxr = r
	end
}

puts cnt
0