結果

問題 No.2154 あさかつの参加人数
ユーザー みここみここ
提出日時 2022-12-10 17:37:08
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,014 ms / 2,000 ms
コード長 392 bytes
コンパイル時間 924 ms
コンパイル使用メモリ 70,616 KB
実行使用メモリ 5,632 KB
最終ジャッジ日時 2024-04-23 00:39:58
合計ジャッジ時間 21,840 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 987 ms
5,504 KB
testcase_01 AC 1,014 ms
5,504 KB
testcase_02 AC 1,001 ms
5,376 KB
testcase_03 AC 1,001 ms
5,632 KB
testcase_04 AC 1,012 ms
5,376 KB
testcase_05 AC 176 ms
5,376 KB
testcase_06 AC 567 ms
5,632 KB
testcase_07 AC 567 ms
5,632 KB
testcase_08 AC 630 ms
5,376 KB
testcase_09 AC 352 ms
5,504 KB
testcase_10 AC 513 ms
5,632 KB
testcase_11 AC 882 ms
5,504 KB
testcase_12 AC 612 ms
5,504 KB
testcase_13 AC 288 ms
5,632 KB
testcase_14 AC 626 ms
5,632 KB
testcase_15 AC 591 ms
5,632 KB
testcase_16 AC 675 ms
5,504 KB
testcase_17 AC 632 ms
5,504 KB
testcase_18 AC 776 ms
5,504 KB
testcase_19 AC 84 ms
5,504 KB
testcase_20 AC 711 ms
5,632 KB
testcase_21 AC 318 ms
5,632 KB
testcase_22 AC 642 ms
5,504 KB
testcase_23 AC 761 ms
5,504 KB
testcase_24 AC 883 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

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