結果

問題 No.2154 あさかつの参加人数
ユーザー nono00
提出日時 2022-12-10 07:46:29
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 1,014 ms / 2,000 ms
コード長 373 bytes
コンパイル時間 577 ms
コンパイル使用メモリ 71,008 KB
最終ジャッジ日時 2025-02-09 09:03:40
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

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