結果

問題 No.2154 あさかつの参加人数
ユーザー ぷらぷら
提出日時 2022-12-09 21:23:53
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
AC  
実行時間 147 ms / 2,000 ms
コード長 393 bytes
コンパイル時間 2,208 ms
コンパイル使用メモリ 201,072 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-14 19:01:14
合計ジャッジ時間 8,888 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int N,M;
    cin >> N >> M;
    vector<int>ans(N+1);
    for(int i = 0; i < M; i++) {
        int L,R;
        cin >> L >> R;
        ans[N-L]++;
        ans[N-R+1]--;
    }
    for(int i = 0; i < N; i++) {
        ans[i+1] += ans[i];
        cout << ans[i] << "\n";
    }
}
0