結果

問題 No.2154 あさかつの参加人数
ユーザー ripityripity
提出日時 2022-12-09 21:39:20
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 804 ms / 2,000 ms
コード長 523 bytes
コンパイル時間 3,132 ms
コンパイル使用メモリ 218,568 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-27 04:20:30
合計ジャッジ時間 20,404 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 762 ms
6,812 KB
testcase_01 AC 804 ms
6,944 KB
testcase_02 AC 770 ms
6,940 KB
testcase_03 AC 742 ms
6,940 KB
testcase_04 AC 776 ms
6,940 KB
testcase_05 AC 64 ms
6,944 KB
testcase_06 AC 368 ms
6,940 KB
testcase_07 AC 457 ms
6,940 KB
testcase_08 AC 524 ms
6,940 KB
testcase_09 AC 344 ms
6,940 KB
testcase_10 AC 413 ms
6,940 KB
testcase_11 AC 663 ms
6,940 KB
testcase_12 AC 445 ms
6,944 KB
testcase_13 AC 185 ms
6,940 KB
testcase_14 AC 437 ms
6,940 KB
testcase_15 AC 506 ms
6,944 KB
testcase_16 AC 507 ms
6,944 KB
testcase_17 AC 437 ms
6,944 KB
testcase_18 AC 565 ms
6,944 KB
testcase_19 AC 72 ms
6,940 KB
testcase_20 AC 556 ms
6,940 KB
testcase_21 AC 305 ms
6,940 KB
testcase_22 AC 594 ms
6,940 KB
testcase_23 AC 570 ms
6,940 KB
testcase_24 AC 645 ms
6,948 KB
権限があれば一括ダウンロードができます

ソースコード

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