結果

問題 No.2154 あさかつの参加人数
ユーザー ymmtr(せるたわーしーぷ!)ymmtr(せるたわーしーぷ!)
提出日時 2022-12-09 21:39:11
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,026 ms / 2,000 ms
コード長 498 bytes
コンパイル時間 1,798 ms
コンパイル使用メモリ 163,572 KB
実行使用メモリ 7,172 KB
最終ジャッジ日時 2024-04-22 21:20:18
合計ジャッジ時間 23,172 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,026 ms
7,172 KB
testcase_01 AC 1,013 ms
7,088 KB
testcase_02 AC 1,026 ms
7,156 KB
testcase_03 AC 1,024 ms
7,084 KB
testcase_04 AC 1,012 ms
7,088 KB
testcase_05 AC 176 ms
5,376 KB
testcase_06 AC 575 ms
5,376 KB
testcase_07 AC 577 ms
5,888 KB
testcase_08 AC 628 ms
6,272 KB
testcase_09 AC 365 ms
5,376 KB
testcase_10 AC 517 ms
5,504 KB
testcase_11 AC 901 ms
6,656 KB
testcase_12 AC 630 ms
5,504 KB
testcase_13 AC 292 ms
5,376 KB
testcase_14 AC 643 ms
5,376 KB
testcase_15 AC 589 ms
6,144 KB
testcase_16 AC 688 ms
5,760 KB
testcase_17 AC 653 ms
5,376 KB
testcase_18 AC 779 ms
6,016 KB
testcase_19 AC 84 ms
5,376 KB
testcase_20 AC 731 ms
6,144 KB
testcase_21 AC 323 ms
5,376 KB
testcase_22 AC 638 ms
6,912 KB
testcase_23 AC 792 ms
6,144 KB
testcase_24 AC 896 ms
6,784 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

//B
#include <bits/stdc++.h>
//#include <atcoder/all>
using namespace std;
using ll = long long;
#define ALL(a)  (a).begin(),(a).end()
using v_vll = vector<vector<ll>>;
int main(){
    ll n,m;cin>>n>>m;
    vector<ll> data(n+10);
    ll l,r;
    for(ll i=0;i<m;i++){
        cin>>l>>r;
        data[n-l]++;
        data[n-r+1]--;

    }
    for(ll i=1;i<n+5;i++){
        data[i]+=data[i-1];
    }
    for(ll i=0;i<n;i++){
        cout<<data[i]<<endl;
    }
    //5,4,3,2,1
    // ,1, , , ,-1 , ,
}
0