結果

問題 No.2154 あさかつの参加人数
ユーザー KowerKoint2010KowerKoint2010
提出日時 2022-11-24 23:34:05
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 615 bytes
コンパイル時間 2,325 ms
コンパイル使用メモリ 75,460 KB
実行使用メモリ 83,708 KB
最終ジャッジ日時 2024-04-08 20:39:30
合計ジャッジ時間 63,631 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 TLE -
testcase_02 TLE -
testcase_03 TLE -
testcase_04 TLE -
testcase_05 AC 1,177 ms
73,536 KB
testcase_06 AC 1,985 ms
76,316 KB
testcase_07 AC 1,901 ms
80,148 KB
testcase_08 AC 1,979 ms
81,016 KB
testcase_09 AC 1,463 ms
78,212 KB
testcase_10 AC 1,805 ms
80,140 KB
testcase_11 TLE -
testcase_12 TLE -
testcase_13 AC 1,502 ms
72,144 KB
testcase_14 TLE -
testcase_15 AC 1,924 ms
78,544 KB
testcase_16 TLE -
testcase_17 TLE -
testcase_18 TLE -
testcase_19 AC 781 ms
72,960 KB
testcase_20 TLE -
testcase_21 AC 1,334 ms
75,168 KB
testcase_22 TLE -
testcase_23 TLE -
testcase_24 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main{
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n=s.nextInt();
        int m=s.nextInt();
        ArrayList<Integer> imos=new ArrayList<Integer>();
        for(int i=0;i<n+1;i++)imos.add(0);
        for(int i=0;i<m;i++){
            int l=s.nextInt();
            int r=s.nextInt();
            imos.set(n-l,imos.get(n-l)+1);
            imos.set(n-r+1,imos.get(n-r+1)-1);
        }
        for(int i=0;i<n;i++){
            imos.set(i+1,imos.get(i+1)+imos.get(i));
            System.out.println(imos.get(i));
        }

    }
}
0