結果

問題 No.2154 あさかつの参加人数
ユーザー umimelumimel
提出日時 2022-12-09 21:27:21
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 1,015 ms / 2,000 ms
コード長 660 bytes
コンパイル時間 1,863 ms
コンパイル使用メモリ 163,736 KB
実行使用メモリ 7,296 KB
最終ジャッジ日時 2024-04-22 20:22:09
合計ジャッジ時間 23,890 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,006 ms
7,296 KB
testcase_01 AC 1,015 ms
7,168 KB
testcase_02 AC 1,013 ms
7,296 KB
testcase_03 AC 1,011 ms
7,168 KB
testcase_04 AC 1,010 ms
7,168 KB
testcase_05 AC 173 ms
5,376 KB
testcase_06 AC 575 ms
5,376 KB
testcase_07 AC 570 ms
5,760 KB
testcase_08 AC 619 ms
6,272 KB
testcase_09 AC 366 ms
5,376 KB
testcase_10 AC 518 ms
5,504 KB
testcase_11 AC 894 ms
6,656 KB
testcase_12 AC 630 ms
5,504 KB
testcase_13 AC 293 ms
5,376 KB
testcase_14 AC 626 ms
5,376 KB
testcase_15 AC 588 ms
6,016 KB
testcase_16 AC 697 ms
5,888 KB
testcase_17 AC 663 ms
5,376 KB
testcase_18 AC 788 ms
6,144 KB
testcase_19 AC 84 ms
5,376 KB
testcase_20 AC 735 ms
6,144 KB
testcase_21 AC 313 ms
5,376 KB
testcase_22 AC 624 ms
6,912 KB
testcase_23 AC 773 ms
6,144 KB
testcase_24 AC 902 ms
6,784 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
#define drep(i, cc, n) for (ll i = (cc); i <= (n); ++i)
#define rep(i, n) drep(i, 0, n - 1)
#define all(a) (a).begin(), (a).end()
#define pb push_back
#define fi first
#define se second

const ll MOD = 1000000007;
const ll MOD2 = 998244353;
const ll INF = 1LL << 60;
const ll MAX_N = 2e5;

int main(){
    ll n, m;
    cin >> n >> m;

    vector<ll> imos(n+2, 0);
    rep(i, m){
        ll l, r;
        cin >> l >> r;
        imos[r]++;
        imos[l+1]--;
    }

    for(ll i=1; i<=n; i++) imos[i]+=imos[i-1];
    for(ll i=n; i>=1; i--) cout << imos[i] << endl;
}
0