結果

問題 No.2154 あさかつの参加人数
ユーザー yansi819yansi819
提出日時 2024-03-19 13:02:56
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,016 ms / 2,000 ms
コード長 364 bytes
コンパイル時間 4,344 ms
コンパイル使用メモリ 262,236 KB
実行使用メモリ 7,508 KB
最終ジャッジ日時 2024-03-19 13:03:25
合計ジャッジ時間 29,174 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 979 ms
7,508 KB
testcase_01 AC 986 ms
7,500 KB
testcase_02 AC 1,016 ms
7,496 KB
testcase_03 AC 1,000 ms
7,496 KB
testcase_04 AC 1,010 ms
7,496 KB
testcase_05 AC 172 ms
6,676 KB
testcase_06 AC 575 ms
6,676 KB
testcase_07 AC 564 ms
6,676 KB
testcase_08 AC 632 ms
6,676 KB
testcase_09 AC 353 ms
6,676 KB
testcase_10 AC 526 ms
6,676 KB
testcase_11 AC 859 ms
7,120 KB
testcase_12 AC 628 ms
6,676 KB
testcase_13 AC 279 ms
6,676 KB
testcase_14 AC 630 ms
6,676 KB
testcase_15 AC 574 ms
6,676 KB
testcase_16 AC 663 ms
6,676 KB
testcase_17 AC 636 ms
6,676 KB
testcase_18 AC 791 ms
6,676 KB
testcase_19 AC 82 ms
6,676 KB
testcase_20 AC 699 ms
6,676 KB
testcase_21 AC 312 ms
6,676 KB
testcase_22 AC 618 ms
7,240 KB
testcase_23 AC 765 ms
6,676 KB
testcase_24 AC 900 ms
6,988 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;

int N, M;
ll A[505050];

int main() {
  cin >> N >> M;
  for (int i = 1; i <= M; i++) {
    int L, R; cin >> L >> R;
    A[L]++;
    A[R - 1]--;
  }
  for (int i = N; i >= 1; i--) {
    cout << A[i] << endl;
    A[i - 1] += A[i];
  }
  return 0;
}
0