結果

問題 No.2154 あさかつの参加人数
ユーザー MAHAYANAMAHAYANA
提出日時 2023-11-04 17:13:53
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 969 ms / 2,000 ms
コード長 537 bytes
コンパイル時間 3,539 ms
コンパイル使用メモリ 246,832 KB
実行使用メモリ 9,064 KB
最終ジャッジ日時 2023-11-04 17:14:22
合計ジャッジ時間 28,991 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 966 ms
9,064 KB
testcase_01 AC 969 ms
9,064 KB
testcase_02 AC 968 ms
9,064 KB
testcase_03 AC 955 ms
9,064 KB
testcase_04 AC 938 ms
9,064 KB
testcase_05 AC 201 ms
8,008 KB
testcase_06 AC 539 ms
8,800 KB
testcase_07 AC 543 ms
6,952 KB
testcase_08 AC 591 ms
6,688 KB
testcase_09 AC 349 ms
5,368 KB
testcase_10 AC 521 ms
6,688 KB
testcase_11 AC 839 ms
8,536 KB
testcase_12 AC 580 ms
8,008 KB
testcase_13 AC 277 ms
7,216 KB
testcase_14 AC 617 ms
8,536 KB
testcase_15 AC 559 ms
6,688 KB
testcase_16 AC 652 ms
8,008 KB
testcase_17 AC 622 ms
8,800 KB
testcase_18 AC 737 ms
8,800 KB
testcase_19 AC 84 ms
5,368 KB
testcase_20 AC 718 ms
7,744 KB
testcase_21 AC 309 ms
5,368 KB
testcase_22 AC 639 ms
5,368 KB
testcase_23 AC 725 ms
8,536 KB
testcase_24 AC 845 ms
8,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,m,n) for(int i=m; i<n; ++i)
#define repl(i,m,n) for(ll i=m; i<n; ++i)

int main(){
    int N, K;
    cin >> N >> K;

    vector<int> L(K), R(K);
    rep(i, 0, K){
        cin >> L[i] >> R[i];
    }

    vector<int> table(500100, 0);
    rep(i, 0, K){
        table[R[i]] += 1;
        table[L[i]+1] -= 1;
    }

    rep(i, 1, N+1){
        table[i] += table[i-1];
    }

    for(int i=N; i>0; --i){
        cout << table[i] << endl;
    } 

    return 0;
}
0