結果

問題 No.2154 あさかつの参加人数
ユーザー kpinkcatkpinkcat
提出日時 2023-09-24 13:14:49
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 995 ms / 2,000 ms
コード長 577 bytes
コンパイル時間 2,590 ms
コンパイル使用メモリ 199,024 KB
実行使用メモリ 10,932 KB
最終ジャッジ日時 2023-09-24 13:15:19
合計ジャッジ時間 30,080 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 986 ms
10,800 KB
testcase_01 AC 995 ms
10,932 KB
testcase_02 AC 981 ms
10,920 KB
testcase_03 AC 959 ms
10,868 KB
testcase_04 AC 956 ms
10,792 KB
testcase_05 AC 156 ms
4,356 KB
testcase_06 AC 537 ms
6,228 KB
testcase_07 AC 556 ms
8,104 KB
testcase_08 AC 608 ms
8,820 KB
testcase_09 AC 349 ms
6,964 KB
testcase_10 AC 522 ms
7,508 KB
testcase_11 AC 870 ms
9,996 KB
testcase_12 AC 586 ms
7,424 KB
testcase_13 AC 268 ms
4,600 KB
testcase_14 AC 623 ms
7,240 KB
testcase_15 AC 558 ms
8,616 KB
testcase_16 AC 632 ms
8,392 KB
testcase_17 AC 648 ms
7,232 KB
testcase_18 AC 746 ms
8,748 KB
testcase_19 AC 82 ms
4,384 KB
testcase_20 AC 722 ms
9,012 KB
testcase_21 AC 309 ms
6,704 KB
testcase_22 AC 633 ms
10,332 KB
testcase_23 AC 734 ms
8,880 KB
testcase_24 AC 838 ms
9,784 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include<iostream>
#include<map>
#include<vector>
#include <algorithm>
#include<math.h>
#include <iomanip>
#include<set>
#include <numeric>
#include<string>
using ll = long long;
using namespace std;


int main()
{
    ll n, m;
    cin >> n >> m;
    vector<ll> d(n), sum(n);
    for (int i = 0; i < m; i++){
        int be, end;
        cin >> be >> end;
        d[n-be]++;
        if (end != 1) d[n- end + 1]--;
    }
    for (int i = 0; i < n; i++){
        sum[i] += d[i];
        if (i) sum[i] += sum[i-1];
        cout << sum[i] << endl;
    }
}
0