結果

問題 No.2154 あさかつの参加人数
ユーザー kokatsukokatsu
提出日時 2022-12-11 21:56:10
言語 D
(dmd 2.106.1)
結果
AC  
実行時間 418 ms / 2,000 ms
コード長 326 bytes
コンパイル時間 3,459 ms
コンパイル使用メモリ 199,756 KB
実行使用メモリ 5,484 KB
最終ジャッジ日時 2023-09-04 19:21:31
合計ジャッジ時間 14,943 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 415 ms
5,404 KB
testcase_01 AC 412 ms
5,456 KB
testcase_02 AC 415 ms
5,404 KB
testcase_03 AC 417 ms
5,484 KB
testcase_04 AC 418 ms
5,456 KB
testcase_05 AC 160 ms
4,380 KB
testcase_06 AC 304 ms
4,380 KB
testcase_07 AC 212 ms
4,616 KB
testcase_08 AC 209 ms
4,928 KB
testcase_09 AC 82 ms
4,380 KB
testcase_10 AC 187 ms
4,392 KB
testcase_11 AC 356 ms
5,200 KB
testcase_12 AC 276 ms
4,380 KB
testcase_13 AC 156 ms
4,380 KB
testcase_14 AC 294 ms
4,388 KB
testcase_15 AC 200 ms
4,616 KB
testcase_16 AC 290 ms
4,624 KB
testcase_17 AC 325 ms
4,396 KB
testcase_18 AC 346 ms
4,616 KB
testcase_19 AC 26 ms
4,380 KB
testcase_20 AC 286 ms
4,880 KB
testcase_21 AC 70 ms
4,404 KB
testcase_22 AC 140 ms
5,200 KB
testcase_23 AC 330 ms
4,928 KB
testcase_24 AC 367 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import std;

void main() {
    int N, M;
    readf("%d %d\n", N, M);

    auto dp = new int[](N+1);
    foreach (_; 0 .. M) {
        int L, R;
        readf("%d %d\n", L, R);

        ++dp[N-L], --dp[N-R+1];
    }

    foreach (i; 1 .. N+1) {
        dp[i] += dp[i-1];
    }

    dp.popBack;

    foreach (d; dp) d.writeln;
}
0