結果

問題 No.2154 あさかつの参加人数
ユーザー MazesobaMazesoba
提出日時 2022-12-09 21:26:30
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,002 ms / 2,000 ms
コード長 868 bytes
コンパイル時間 4,418 ms
コンパイル使用メモリ 253,180 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-22 20:12:37
合計ジャッジ時間 25,820 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 987 ms
5,248 KB
testcase_01 AC 982 ms
5,376 KB
testcase_02 AC 984 ms
5,376 KB
testcase_03 AC 1,002 ms
5,376 KB
testcase_04 AC 993 ms
5,376 KB
testcase_05 AC 174 ms
5,376 KB
testcase_06 AC 559 ms
5,376 KB
testcase_07 AC 555 ms
5,376 KB
testcase_08 AC 616 ms
5,376 KB
testcase_09 AC 352 ms
5,376 KB
testcase_10 AC 503 ms
5,376 KB
testcase_11 AC 868 ms
5,376 KB
testcase_12 AC 596 ms
5,376 KB
testcase_13 AC 281 ms
5,376 KB
testcase_14 AC 622 ms
5,376 KB
testcase_15 AC 598 ms
5,376 KB
testcase_16 AC 673 ms
5,376 KB
testcase_17 AC 645 ms
5,376 KB
testcase_18 AC 780 ms
5,376 KB
testcase_19 AC 83 ms
5,376 KB
testcase_20 AC 718 ms
5,376 KB
testcase_21 AC 318 ms
5,376 KB
testcase_22 AC 614 ms
5,376 KB
testcase_23 AC 759 ms
5,376 KB
testcase_24 AC 891 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <atcoder/all>
#include <bits/stdc++.h>

using namespace std;

//#define DISABLE_PRINT

#if defined(ENABLE_PRINT) && !defined(DISABLE_PRINT)

#define P(...) fprintf(stderr, __VA_ARGS__)
#define LP fprintf(stderr, "L: %d\n", __LINE__)

#else

#define P(...) ((void)0)
#define LP ((void)0)

#endif

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define ALL(x) x.begin(), x.end()

using ll = long long;
using ull = unsigned long long;

const int INF = 1100100100;
const ll INFLL = 1100100100100100100;

int main() {
    int N, M;
    cin >> N >> M;
    vector<int> sums(N + 1);
    rep(i, M) {
        int L, R;
        cin >> L >> R;
        auto l = N - L;
        auto r = N - R + 1;
        sums[l]++;
        sums[r]--;
    }
    rep(i, N) {
        sums[i + 1] += sums[i];
    }
    rep(i, N) {
        cout << sums[i] << endl;
    }
    return 0;
}
0