結果

問題 No.2154 あさかつの参加人数
ユーザー MichirakaraMichirakara
提出日時 2022-11-24 14:07:24
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 645 bytes
コンパイル時間 2,443 ms
コンパイル使用メモリ 75,396 KB
実行使用メモリ 95,456 KB
最終ジャッジ日時 2024-04-08 20:46:51
合計ジャッジ時間 10,389 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 TLE -
testcase_02 TLE -
testcase_03 TLE -
testcase_04 TLE -
testcase_05 AC 1,190 ms
73,760 KB
testcase_06 TLE -
testcase_07 AC 1,894 ms
78,324 KB
testcase_08 AC 1,948 ms
80,276 KB
testcase_09 AC 1,660 ms
78,228 KB
testcase_10 AC 1,802 ms
78,112 KB
testcase_11 TLE -
testcase_12 TLE -
testcase_13 AC 1,582 ms
74,060 KB
testcase_14 TLE -
testcase_15 AC 1,984 ms
80,560 KB
testcase_16 TLE -
testcase_17 TLE -
testcase_18 TLE -
testcase_19 AC 786 ms
73,088 KB
testcase_20 TLE -
testcase_21 AC 1,349 ms
77,188 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();
        Integer zero=0;
        ArrayList<Integer> imos=new ArrayList<Integer>(n+1);
        for(int i=0;i<n+1;i++)imos.add(zero);
        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