結果

問題 No.2154 あさかつの参加人数
ユーザー nyyanyya
提出日時 2022-12-09 22:01:23
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 935 ms / 2,000 ms
コード長 789 bytes
コンパイル時間 3,535 ms
コンパイル使用メモリ 226,748 KB
実行使用メモリ 5,180 KB
最終ジャッジ日時 2023-08-04 23:42:16
合計ジャッジ時間 23,477 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 920 ms
4,924 KB
testcase_01 AC 914 ms
5,064 KB
testcase_02 AC 926 ms
5,020 KB
testcase_03 AC 935 ms
5,180 KB
testcase_04 AC 925 ms
4,884 KB
testcase_05 AC 156 ms
4,380 KB
testcase_06 AC 503 ms
4,380 KB
testcase_07 AC 542 ms
4,400 KB
testcase_08 AC 583 ms
4,380 KB
testcase_09 AC 334 ms
4,380 KB
testcase_10 AC 472 ms
4,380 KB
testcase_11 AC 796 ms
4,920 KB
testcase_12 AC 550 ms
4,380 KB
testcase_13 AC 260 ms
4,380 KB
testcase_14 AC 571 ms
4,376 KB
testcase_15 AC 551 ms
4,380 KB
testcase_16 AC 615 ms
4,468 KB
testcase_17 AC 602 ms
4,384 KB
testcase_18 AC 733 ms
4,392 KB
testcase_19 AC 82 ms
4,380 KB
testcase_20 AC 675 ms
4,664 KB
testcase_21 AC 299 ms
4,384 KB
testcase_22 AC 617 ms
4,900 KB
testcase_23 AC 712 ms
4,392 KB
testcase_24 AC 822 ms
4,624 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