結果

問題 No.2154 あさかつの参加人数
ユーザー Ryuki87241978Ryuki87241978
提出日時 2022-12-09 22:04:15
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
AC  
実行時間 891 ms / 2,000 ms
コード長 388 bytes
コンパイル時間 2,426 ms
コンパイル使用メモリ 163,772 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-22 22:12:50
合計ジャッジ時間 21,422 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 888 ms
6,812 KB
testcase_01 AC 857 ms
6,940 KB
testcase_02 AC 891 ms
6,944 KB
testcase_03 AC 853 ms
6,940 KB
testcase_04 AC 887 ms
6,940 KB
testcase_05 AC 153 ms
6,944 KB
testcase_06 AC 494 ms
6,944 KB
testcase_07 AC 491 ms
6,944 KB
testcase_08 AC 545 ms
6,940 KB
testcase_09 AC 315 ms
6,944 KB
testcase_10 AC 441 ms
6,940 KB
testcase_11 AC 746 ms
6,944 KB
testcase_12 AC 522 ms
6,944 KB
testcase_13 AC 243 ms
6,940 KB
testcase_14 AC 531 ms
6,940 KB
testcase_15 AC 515 ms
6,940 KB
testcase_16 AC 572 ms
6,940 KB
testcase_17 AC 561 ms
6,944 KB
testcase_18 AC 654 ms
6,940 KB
testcase_19 AC 73 ms
6,940 KB
testcase_20 AC 635 ms
6,944 KB
testcase_21 AC 290 ms
6,940 KB
testcase_22 AC 573 ms
6,944 KB
testcase_23 AC 672 ms
6,944 KB
testcase_24 AC 756 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
    
    int N, M;
    cin >> N >> M;
    vector<int> dp(N+1);
    for(int i=0; i<M; i++) {
        int L, R;
        cin >> L >> R;
        dp[N-L] += 1;
        dp[N-R+1] -= 1;
    }
    for(int i=1; i<N; i++) {
        dp[i] += dp[i-1];
    }
    for(int i=0; i<N; i++) {
        cout << dp[i] << endl;
    }
    return 0;

}
0