結果

問題 No.2154 あさかつの参加人数
ユーザー ripity
提出日時 2022-12-09 21:39:20
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
AC  
実行時間 742 ms / 2,000 ms
コード長 523 bytes
コンパイル時間 10,380 ms
コンパイル使用メモリ 273,964 KB
最終ジャッジ日時 2025-02-09 07:37:41
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, M;
    cin >> N >> M;
    vector<int> cnt(N+1);
    for( int i = 0; i < M; i++ ) {
        int L, R;
        cin >> L >> R;
        cnt[R-1]++;
        cnt[L]--;
    }
    for( int i = 0; i < N; i++ ) {
        cnt[i+1] += cnt[i];
    }
    for( int i = N-1; i >= 0; i-- ) {
        cout << cnt[i] << endl;
    }
}
0