結果

問題 No.2154 あさかつの参加人数
ユーザー nono00nono00
提出日時 2022-12-10 07:46:29
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,036 ms / 2,000 ms
コード長 373 bytes
コンパイル時間 902 ms
コンパイル使用メモリ 73,952 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-22 23:39:29
合計ジャッジ時間 22,450 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,019 ms
5,248 KB
testcase_01 AC 1,024 ms
5,376 KB
testcase_02 AC 1,036 ms
5,376 KB
testcase_03 AC 1,002 ms
5,376 KB
testcase_04 AC 1,022 ms
5,376 KB
testcase_05 AC 175 ms
5,376 KB
testcase_06 AC 569 ms
5,376 KB
testcase_07 AC 572 ms
5,376 KB
testcase_08 AC 627 ms
5,376 KB
testcase_09 AC 371 ms
5,376 KB
testcase_10 AC 514 ms
5,376 KB
testcase_11 AC 894 ms
5,376 KB
testcase_12 AC 622 ms
5,376 KB
testcase_13 AC 288 ms
5,376 KB
testcase_14 AC 627 ms
5,376 KB
testcase_15 AC 599 ms
5,376 KB
testcase_16 AC 684 ms
5,376 KB
testcase_17 AC 658 ms
5,376 KB
testcase_18 AC 802 ms
5,376 KB
testcase_19 AC 86 ms
5,376 KB
testcase_20 AC 737 ms
5,376 KB
testcase_21 AC 323 ms
5,376 KB
testcase_22 AC 642 ms
5,376 KB
testcase_23 AC 772 ms
5,376 KB
testcase_24 AC 896 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>

using namespace std;

int main() {
    int n, m;
    cin >> n >> m;
    vector<int> cum(n + 1, 0);

    for (int i = 0; i < m; i++) {
        int l, r;
        cin >> l >> r;
        cum[n - l]++;
        cum[n - r + 1]--;
    }

    for (int i = 0; i < n; i++) {
        cum[i + 1] += cum[i];
        cout << cum[i] << endl;
    }
}
0