結果

問題 No.2154 あさかつの参加人数
ユーザー KKT89KKT89
提出日時 2024-02-01 14:18:04
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 129 ms / 2,000 ms
コード長 628 bytes
コンパイル時間 2,386 ms
コンパイル使用メモリ 213,372 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-02-01 14:18:17
合計ジャッジ時間 8,515 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
6,676 KB
testcase_01 AC 122 ms
6,676 KB
testcase_02 AC 120 ms
6,676 KB
testcase_03 AC 120 ms
6,676 KB
testcase_04 AC 123 ms
6,676 KB
testcase_05 AC 53 ms
6,676 KB
testcase_06 AC 111 ms
6,676 KB
testcase_07 AC 64 ms
6,676 KB
testcase_08 AC 62 ms
6,676 KB
testcase_09 AC 22 ms
6,676 KB
testcase_10 AC 55 ms
6,676 KB
testcase_11 AC 106 ms
6,676 KB
testcase_12 AC 86 ms
6,676 KB
testcase_13 AC 48 ms
6,676 KB
testcase_14 AC 89 ms
6,676 KB
testcase_15 AC 56 ms
6,676 KB
testcase_16 AC 87 ms
6,676 KB
testcase_17 AC 98 ms
6,676 KB
testcase_18 AC 109 ms
6,676 KB
testcase_19 AC 8 ms
6,676 KB
testcase_20 AC 94 ms
6,676 KB
testcase_21 AC 18 ms
6,676 KB
testcase_22 AC 35 ms
6,676 KB
testcase_23 AC 95 ms
6,676 KB
testcase_24 AC 107 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll myRand(ll B) { return (ull)rng() % B; }

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n, m;
    cin >> n >> m;
    vector<int> imos(n + 1);
    for (int i = 0; i < m; i++) {
        int a, b;
        cin >> a >> b;
        imos[n - b + 1] -= 1;
        imos[n - a] += 1;
    }
    for (int i = 0; i < n; i++) {
        imos[i + 1] += imos[i];
        cout << imos[i] << "\n";
    }
}
0