結果
| 問題 |
No.2154 あさかつの参加人数
|
| コンテスト | |
| ユーザー |
horiesiniti
|
| 提出日時 | 2022-12-28 17:25:55 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 1,360 ms / 2,000 ms |
| コード長 | 172 bytes |
| コンパイル時間 | 386 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 16,384 KB |
| 最終ジャッジ日時 | 2024-11-23 18:48:13 |
| 合計ジャッジ時間 | 31,499 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 25 |
コンパイルメッセージ
Syntax OK
ソースコード
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
}
horiesiniti