結果

問題 No.2154 あさかつの参加人数
ユーザー hourenhouren
提出日時 2022-12-09 21:24:45
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 174 ms / 2,000 ms
コード長 784 bytes
コンパイル時間 2,054 ms
コンパイル使用メモリ 163,120 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-22 19:31:42
合計ジャッジ時間 9,015 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 173 ms
5,248 KB
testcase_01 AC 170 ms
5,376 KB
testcase_02 AC 165 ms
5,376 KB
testcase_03 AC 174 ms
5,376 KB
testcase_04 AC 164 ms
5,376 KB
testcase_05 AC 61 ms
5,376 KB
testcase_06 AC 117 ms
5,376 KB
testcase_07 AC 78 ms
5,376 KB
testcase_08 AC 75 ms
5,376 KB
testcase_09 AC 23 ms
5,376 KB
testcase_10 AC 67 ms
5,376 KB
testcase_11 AC 145 ms
5,376 KB
testcase_12 AC 104 ms
5,376 KB
testcase_13 AC 54 ms
5,376 KB
testcase_14 AC 110 ms
5,376 KB
testcase_15 AC 72 ms
5,376 KB
testcase_16 AC 109 ms
5,376 KB
testcase_17 AC 122 ms
5,376 KB
testcase_18 AC 139 ms
5,376 KB
testcase_19 AC 10 ms
5,376 KB
testcase_20 AC 108 ms
5,376 KB
testcase_21 AC 18 ms
5,376 KB
testcase_22 AC 36 ms
5,376 KB
testcase_23 AC 130 ms
5,376 KB
testcase_24 AC 153 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
#define fix(x) fixed << setprecision(x)
#define asc(x) x, vector<x>, greater<x>
#define rep(i, n) for(ll i = 0; i < n; i++)
#define all(x) (x).begin(),(x).end()
template<class T>bool chmin(T&a, const T&b){if(a>b){a=b;return 1;}return 0;}
template<class T>bool chmax(T&a, const T&b){if(a<b){a=b;return 1;}return 0;}
constexpr ll INFLL = (1LL <<62);
constexpr int INF = (1<<30);
int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n,m;
    cin >> n >> m;
    vector<int> ans(n+1, 0);
    rep(i,m){
        int l,r;
        cin >> l >> r;
        ans[n-l]++;
        ans[n-r+1]--;
    }
    rep(i,n) ans[i+1] += ans[i];
    rep(i,n) cout << ans[i] << '\n';
    return 0;
}
0