結果

問題 No.2154 あさかつの参加人数
ユーザー FplusFplusFFplusFplusF
提出日時 2022-12-09 21:25:42
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 927 ms / 2,000 ms
コード長 646 bytes
コンパイル時間 2,519 ms
コンパイル使用メモリ 194,580 KB
実行使用メモリ 7,168 KB
最終ジャッジ日時 2024-04-22 19:59:56
合計ジャッジ時間 21,871 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 899 ms
7,168 KB
testcase_01 AC 881 ms
7,168 KB
testcase_02 AC 894 ms
7,168 KB
testcase_03 AC 893 ms
7,040 KB
testcase_04 AC 927 ms
7,168 KB
testcase_05 AC 155 ms
5,376 KB
testcase_06 AC 486 ms
5,376 KB
testcase_07 AC 514 ms
5,888 KB
testcase_08 AC 561 ms
6,144 KB
testcase_09 AC 326 ms
5,376 KB
testcase_10 AC 450 ms
5,504 KB
testcase_11 AC 779 ms
6,656 KB
testcase_12 AC 536 ms
5,504 KB
testcase_13 AC 253 ms
5,376 KB
testcase_14 AC 548 ms
5,376 KB
testcase_15 AC 505 ms
6,144 KB
testcase_16 AC 573 ms
5,760 KB
testcase_17 AC 574 ms
5,376 KB
testcase_18 AC 678 ms
6,016 KB
testcase_19 AC 80 ms
5,376 KB
testcase_20 AC 628 ms
6,144 KB
testcase_21 AC 273 ms
5,376 KB
testcase_22 AC 640 ms
6,784 KB
testcase_23 AC 798 ms
6,144 KB
testcase_24 AC 778 ms
6,656 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (long long i=0;i<(long long)(n);i++)
#define all(v) v.begin(),v.end()
using ll=long long;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll,ll>;
const ll INF=(1ll<<60);
template<class T> void chmin(T &a,T b){
    if(a>b){
        a=b;
    }
}
template<class T> void chmax(T &a,T b){
    if(a<b){
        a=b;
    }
}
int main(){
    ll n,m;
    cin >> n >> m;
    vector<ll> ans(n+1,0);
    while(m--){
        ll l,r;
        cin >> l >> r;
        l=n-l;
        r=n-r;
        ans[l]++;
        ans[r+1]--;
    }
    rep(i,n) ans[i+1]+=ans[i];
    rep(i,n) cout << ans[i] << endl;
}
0