結果

問題 No.2154 あさかつの参加人数
ユーザー Carpenters-CatCarpenters-Cat
提出日時 2022-12-09 21:42:17
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 932 ms / 2,000 ms
コード長 430 bytes
コンパイル時間 3,824 ms
コンパイル使用メモリ 199,296 KB
実行使用メモリ 5,004 KB
最終ジャッジ日時 2023-08-04 23:04:16
合計ジャッジ時間 22,086 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 908 ms
4,916 KB
testcase_01 AC 932 ms
4,828 KB
testcase_02 AC 909 ms
4,920 KB
testcase_03 AC 913 ms
4,872 KB
testcase_04 AC 926 ms
4,952 KB
testcase_05 AC 156 ms
4,384 KB
testcase_06 AC 509 ms
4,384 KB
testcase_07 AC 530 ms
4,388 KB
testcase_08 AC 579 ms
4,388 KB
testcase_09 AC 349 ms
4,388 KB
testcase_10 AC 477 ms
4,384 KB
testcase_11 AC 814 ms
5,004 KB
testcase_12 AC 573 ms
4,388 KB
testcase_13 AC 266 ms
4,388 KB
testcase_14 AC 563 ms
4,384 KB
testcase_15 AC 547 ms
4,388 KB
testcase_16 AC 621 ms
4,388 KB
testcase_17 AC 595 ms
4,388 KB
testcase_18 AC 723 ms
4,420 KB
testcase_19 AC 82 ms
4,384 KB
testcase_20 AC 679 ms
4,668 KB
testcase_21 AC 314 ms
4,384 KB
testcase_22 AC 617 ms
4,932 KB
testcase_23 AC 697 ms
4,384 KB
testcase_24 AC 803 ms
4,596 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main () {
    int N, M;
    cin >> N >> M;
    std::vector<int> A(N, 0);
    for (int i = 0; i < M; i ++) {
        int l, r;
        cin >> l >> r;
        A[l - 1] ++;
        if (r > 1) {
            A[r - 2] --;
        }
    }
    for (int i = N - 1; i > 0; i --) {
        A[i - 1] += A[i];
    }
    for (int i = N - 1; i >= 0; i --) {
        cout << A[i] << endl;
    }
}
0