結果
| 問題 |
No.2154 あさかつの参加人数
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-12-14 18:37:18 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 1,707 ms / 2,000 ms |
| コード長 | 656 bytes |
| コンパイル時間 | 2,337 ms |
| コンパイル使用メモリ | 74,544 KB |
| 実行使用メモリ | 62,224 KB |
| 最終ジャッジ日時 | 2024-12-20 12:51:05 |
| 合計ジャッジ時間 | 44,595 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 25 |
ソースコード
import java.util.*;
import java.io.*;
class Main{
public static final int INF = Integer.MAX_VALUE;
public static PrintWriter out = new PrintWriter(System.out);
public static Scanner sc = new Scanner(System.in);
public static void main(String[] args) throws IOException {
int N = sc.nextInt();
int M = sc.nextInt();
int [] m = new int[N+1];
for(int i=0;i<M;i++){
int l = sc.nextInt();
int r = sc.nextInt();
m[r-1]++;
m[l]--;
}
for(int i=0;i<N;i++) m[i+1] += m[i];
for(int i=N-1;i>=0;i--) out.println(m[i]);
out.flush();
}
}