結果

問題 No.2154 あさかつの参加人数
ユーザー 👑 rin204rin204
提出日時 2022-12-09 21:24:24
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 429 bytes
コンパイル時間 2,353 ms
コンパイル使用メモリ 194,004 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-22 19:31:26
合計ジャッジ時間 7,694 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
5,248 KB
testcase_01 AC 123 ms
5,376 KB
testcase_02 AC 120 ms
5,376 KB
testcase_03 AC 122 ms
5,376 KB
testcase_04 AC 123 ms
5,376 KB
testcase_05 AC 55 ms
5,376 KB
testcase_06 AC 98 ms
5,376 KB
testcase_07 AC 61 ms
5,376 KB
testcase_08 AC 59 ms
5,376 KB
testcase_09 AC 18 ms
5,376 KB
testcase_10 AC 52 ms
5,376 KB
testcase_11 AC 103 ms
5,376 KB
testcase_12 AC 84 ms
5,376 KB
testcase_13 AC 49 ms
5,376 KB
testcase_14 AC 95 ms
5,376 KB
testcase_15 AC 53 ms
5,376 KB
testcase_16 AC 84 ms
5,376 KB
testcase_17 AC 99 ms
5,376 KB
testcase_18 AC 106 ms
5,376 KB
testcase_19 AC 8 ms
5,376 KB
testcase_20 AC 82 ms
5,376 KB
testcase_21 AC 17 ms
5,376 KB
testcase_22 AC 33 ms
5,376 KB
testcase_23 AC 99 ms
5,376 KB
testcase_24 AC 108 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define endl '\n'

int main(){
    cin.tie(0)->sync_with_stdio(0);

    int n, m;
    cin >> n >> m;
    vector<int> imos(n + 1, 0);
    int l, r;
    for(int i = 0; i < m; i++){
        cin >> l >> r;
        imos[n - l]++;
        imos[n - r + 1]--;
    }
    for(int i = 0; i < n; i++){
        cout << imos[i] << endl;
        imos[i + 1] += imos[i];
    }
}
0