結果

問題 No.2154 あさかつの参加人数
ユーザー simansiman
提出日時 2022-12-11 18:04:34
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,259 ms / 2,000 ms
コード長 223 bytes
コンパイル時間 98 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 20,224 KB
最終ジャッジ日時 2024-04-23 14:18:00
合計ジャッジ時間 28,560 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,239 ms
20,096 KB
testcase_01 AC 1,259 ms
20,224 KB
testcase_02 AC 1,225 ms
20,224 KB
testcase_03 AC 1,216 ms
20,224 KB
testcase_04 AC 1,239 ms
20,096 KB
testcase_05 AC 565 ms
12,416 KB
testcase_06 AC 944 ms
15,744 KB
testcase_07 AC 679 ms
17,408 KB
testcase_08 AC 669 ms
18,048 KB
testcase_09 AC 331 ms
16,384 KB
testcase_10 AC 630 ms
16,768 KB
testcase_11 AC 1,088 ms
19,456 KB
testcase_12 AC 847 ms
16,896 KB
testcase_13 AC 541 ms
13,824 KB
testcase_14 AC 927 ms
16,768 KB
testcase_15 AC 669 ms
17,920 KB
testcase_16 AC 898 ms
17,792 KB
testcase_17 AC 999 ms
16,640 KB
testcase_18 AC 1,068 ms
18,176 KB
testcase_19 AC 163 ms
13,056 KB
testcase_20 AC 891 ms
18,304 KB
testcase_21 AC 316 ms
16,128 KB
testcase_22 AC 527 ms
19,584 KB
testcase_23 AC 1,113 ms
18,304 KB
testcase_24 AC 1,117 ms
19,456 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N, M = gets.split.map(&:to_i)

rui = Array.new(N + 2, 0)

M.times do
  l, r = gets.split.map(&:to_i)

  rui[l + 1] -= 1
  rui[r] += 1
end

sum = 0
1.upto(N) do |d|
  sum += rui[d]
  rui[d] = sum
end

puts rui[1..N].reverse
0