結果

問題 No.2154 あさかつの参加人数
ユーザー nyyanyya
提出日時 2022-12-09 22:01:23
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 912 ms / 2,000 ms
コード長 789 bytes
コンパイル時間 3,400 ms
コンパイル使用メモリ 223,668 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-22 22:09:20
合計ジャッジ時間 22,486 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 889 ms
5,376 KB
testcase_01 AC 912 ms
5,376 KB
testcase_02 AC 887 ms
5,376 KB
testcase_03 AC 883 ms
5,376 KB
testcase_04 AC 879 ms
5,376 KB
testcase_05 AC 155 ms
5,376 KB
testcase_06 AC 504 ms
5,376 KB
testcase_07 AC 510 ms
5,376 KB
testcase_08 AC 573 ms
5,376 KB
testcase_09 AC 317 ms
5,376 KB
testcase_10 AC 463 ms
5,376 KB
testcase_11 AC 760 ms
5,376 KB
testcase_12 AC 531 ms
5,376 KB
testcase_13 AC 257 ms
5,376 KB
testcase_14 AC 551 ms
5,376 KB
testcase_15 AC 521 ms
5,376 KB
testcase_16 AC 617 ms
5,376 KB
testcase_17 AC 572 ms
5,376 KB
testcase_18 AC 711 ms
5,376 KB
testcase_19 AC 75 ms
5,376 KB
testcase_20 AC 624 ms
5,376 KB
testcase_21 AC 285 ms
5,376 KB
testcase_22 AC 570 ms
5,376 KB
testcase_23 AC 678 ms
5,376 KB
testcase_24 AC 845 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define rep(i,n) for(int i=0;i<(n);i++)
typedef long long ll;
//using mint = modint;
//using mint = modint998244353;
using mint = modint1000000007;
using P = pair<int, int>;

const ll INF=1LL<<60, dx[]={0,1,0,-1},dy[]={1,0,-1,0};
template <typename T> inline bool chmin(T& a,const T&b) {if(a>b){a=b; return 1;} return 0;}
template <typename T> inline bool chmax(T& a,const T&b) {if(a<b){a=b; return 1;} return 0;}

int main(){

    int n,m;
    cin >> n >> m;

    vector<int> t(n+1);
    rep(i,m) {
        int l,r;
        cin >> l >> r;
        t[l]++;
        t[r-1]--;
    }

    int now=0;
    for(int i=n;i>0;i--) {
        now+=t[i];
        cout << now << endl;;
    }

    return 0;
}
0