結果

問題 No.2154 あさかつの参加人数
ユーザー MichirakaraMichirakara
提出日時 2022-11-24 13:58:31
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 618 bytes
コンパイル時間 2,723 ms
コンパイル使用メモリ 75,000 KB
実行使用メモリ 95,500 KB
最終ジャッジ日時 2024-04-08 20:45:10
合計ジャッジ時間 10,524 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 TLE -
testcase_02 TLE -
testcase_03 TLE -
testcase_04 TLE -
testcase_05 AC 1,219 ms
73,604 KB
testcase_06 TLE -
testcase_07 AC 1,874 ms
78,168 KB
testcase_08 AC 1,972 ms
80,112 KB
testcase_09 AC 1,625 ms
78,188 KB
testcase_10 AC 1,828 ms
78,216 KB
testcase_11 TLE -
testcase_12 TLE -
testcase_13 AC 1,505 ms
74,344 KB
testcase_14 TLE -
testcase_15 AC 1,948 ms
80,112 KB
testcase_16 TLE -
testcase_17 TLE -
testcase_18 TLE -
testcase_19 AC 994 ms
72,996 KB
testcase_20 TLE -
testcase_21 AC 1,374 ms
77,228 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>(n+1);
        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