結果

問題 No.2154 あさかつの参加人数
ユーザー ruthenruthen
提出日時 2022-12-10 16:45:01
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 129 ms / 2,000 ms
コード長 570 bytes
コンパイル時間 2,669 ms
コンパイル使用メモリ 196,200 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-23 00:34:29
合計ジャッジ時間 9,375 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
6,812 KB
testcase_01 AC 121 ms
6,816 KB
testcase_02 AC 120 ms
6,940 KB
testcase_03 AC 121 ms
6,944 KB
testcase_04 AC 129 ms
6,940 KB
testcase_05 AC 55 ms
6,944 KB
testcase_06 AC 95 ms
6,940 KB
testcase_07 AC 62 ms
6,940 KB
testcase_08 AC 57 ms
6,940 KB
testcase_09 AC 19 ms
6,940 KB
testcase_10 AC 53 ms
6,940 KB
testcase_11 AC 103 ms
6,940 KB
testcase_12 AC 80 ms
6,940 KB
testcase_13 AC 46 ms
6,944 KB
testcase_14 AC 89 ms
6,940 KB
testcase_15 AC 53 ms
6,940 KB
testcase_16 AC 87 ms
6,944 KB
testcase_17 AC 99 ms
6,944 KB
testcase_18 AC 103 ms
6,940 KB
testcase_19 AC 8 ms
6,944 KB
testcase_20 AC 83 ms
6,944 KB
testcase_21 AC 15 ms
6,944 KB
testcase_22 AC 30 ms
6,940 KB
testcase_23 AC 97 ms
6,940 KB
testcase_24 AC 107 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

#ifdef _RUTHEN
#include <debug.hpp>
#else
#define show(...) true
#endif

using ll = long long;
#define rep(i, n) for (int i = 0; i < (n); i++)
template <class T> using V = vector<T>;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N, M;
    cin >> N >> M;
    V<int> imos(N + 1);
    rep(i, M) {
        int l, r;
        cin >> r >> l;
        imos[l - 1]++;
        imos[r]--;
    }
    rep(i, N) imos[i + 1] += imos[i];
    for (int i = N - 1; i >= 0; i--) cout << imos[i] << '\n';
    return 0;
}
0