結果

問題 No.2154 あさかつの参加人数
ユーザー ripityripity
提出日時 2022-12-09 21:39:20
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 693 ms / 2,000 ms
コード長 523 bytes
コンパイル時間 5,370 ms
コンパイル使用メモリ 214,004 KB
実行使用メモリ 4,992 KB
最終ジャッジ日時 2023-08-04 22:58:49
合計ジャッジ時間 20,526 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 662 ms
4,732 KB
testcase_01 AC 649 ms
4,832 KB
testcase_02 AC 663 ms
4,816 KB
testcase_03 AC 693 ms
4,732 KB
testcase_04 AC 690 ms
4,992 KB
testcase_05 AC 55 ms
4,384 KB
testcase_06 AC 324 ms
4,384 KB
testcase_07 AC 430 ms
4,380 KB
testcase_08 AC 468 ms
4,716 KB
testcase_09 AC 323 ms
4,384 KB
testcase_10 AC 383 ms
4,384 KB
testcase_11 AC 595 ms
4,832 KB
testcase_12 AC 401 ms
4,384 KB
testcase_13 AC 163 ms
4,380 KB
testcase_14 AC 389 ms
4,384 KB
testcase_15 AC 441 ms
4,388 KB
testcase_16 AC 465 ms
4,512 KB
testcase_17 AC 395 ms
4,388 KB
testcase_18 AC 500 ms
4,388 KB
testcase_19 AC 69 ms
4,380 KB
testcase_20 AC 505 ms
4,592 KB
testcase_21 AC 285 ms
4,384 KB
testcase_22 AC 561 ms
4,840 KB
testcase_23 AC 527 ms
4,628 KB
testcase_24 AC 583 ms
4,508 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