結果

問題 No.2154 あさかつの参加人数
ユーザー 👑 horiesinitihoriesiniti
提出日時 2022-12-28 17:25:55
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,382 ms / 2,000 ms
コード長 172 bytes
コンパイル時間 164 ms
コンパイル使用メモリ 7,296 KB
実行使用メモリ 16,256 KB
最終ジャッジ日時 2024-05-02 23:13:44
合計ジャッジ時間 31,238 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,382 ms
16,128 KB
testcase_01 AC 1,381 ms
16,256 KB
testcase_02 AC 1,380 ms
16,256 KB
testcase_03 AC 1,371 ms
16,256 KB
testcase_04 AC 1,338 ms
16,128 KB
testcase_05 AC 609 ms
16,256 KB
testcase_06 AC 996 ms
16,256 KB
testcase_07 AC 736 ms
16,256 KB
testcase_08 AC 725 ms
16,256 KB
testcase_09 AC 344 ms
16,128 KB
testcase_10 AC 652 ms
16,128 KB
testcase_11 AC 1,161 ms
16,256 KB
testcase_12 AC 920 ms
16,128 KB
testcase_13 AC 560 ms
16,256 KB
testcase_14 AC 985 ms
16,128 KB
testcase_15 AC 691 ms
16,256 KB
testcase_16 AC 975 ms
16,128 KB
testcase_17 AC 1,052 ms
16,256 KB
testcase_18 AC 1,122 ms
16,256 KB
testcase_19 AC 172 ms
16,128 KB
testcase_20 AC 949 ms
16,128 KB
testcase_21 AC 312 ms
16,128 KB
testcase_22 AC 524 ms
16,256 KB
testcase_23 AC 1,089 ms
16,128 KB
testcase_24 AC 1,269 ms
16,256 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

as=Array.new(500002,0)
n,m=gets.split(" ").map{|e| e.to_i}
m.times{
	r,l=gets.split(" ").map{|e| n-e.to_i}
	as[r]+=1
	as[l+1]-=1
}
ans=0
n.times{|i|
	ans+=as[i]
	puts ans
}
0