結果

問題 No.2154 あさかつの参加人数
ユーザー AsahiAsahi
提出日時 2022-12-14 18:37:18
言語 Java21
(openjdk 21)
結果
AC  
実行時間 1,546 ms / 2,000 ms
コード長 656 bytes
コンパイル時間 2,226 ms
コンパイル使用メモリ 74,964 KB
実行使用メモリ 72,340 KB
最終ジャッジ日時 2024-04-25 22:19:41
合計ジャッジ時間 38,431 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,546 ms
72,236 KB
testcase_01 AC 1,516 ms
72,340 KB
testcase_02 AC 1,408 ms
60,636 KB
testcase_03 AC 1,445 ms
64,444 KB
testcase_04 AC 1,510 ms
60,672 KB
testcase_05 AC 1,126 ms
57,680 KB
testcase_06 AC 1,397 ms
60,128 KB
testcase_07 AC 1,229 ms
59,752 KB
testcase_08 AC 1,156 ms
60,652 KB
testcase_09 AC 602 ms
50,508 KB
testcase_10 AC 1,202 ms
60,408 KB
testcase_11 AC 1,320 ms
60,424 KB
testcase_12 AC 1,295 ms
59,708 KB
testcase_13 AC 1,106 ms
59,084 KB
testcase_14 AC 1,296 ms
59,708 KB
testcase_15 AC 1,291 ms
60,096 KB
testcase_16 AC 1,320 ms
61,008 KB
testcase_17 AC 1,416 ms
59,492 KB
testcase_18 AC 1,480 ms
60,152 KB
testcase_19 AC 451 ms
48,456 KB
testcase_20 AC 1,263 ms
60,088 KB
testcase_21 AC 519 ms
49,100 KB
testcase_22 AC 706 ms
52,628 KB
testcase_23 AC 1,302 ms
59,896 KB
testcase_24 AC 1,430 ms
61,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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();
    }
}
0