結果

問題 No.2154 あさかつの参加人数
ユーザー hatsuka_iwahatsuka_iwa
提出日時 2023-11-12 21:02:14
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 978 ms / 2,000 ms
コード長 328 bytes
コンパイル時間 1,677 ms
コンパイル使用メモリ 168,936 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2023-11-12 21:02:45
合計ジャッジ時間 27,799 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 973 ms
6,676 KB
testcase_01 AC 975 ms
6,676 KB
testcase_02 AC 978 ms
6,676 KB
testcase_03 AC 976 ms
6,676 KB
testcase_04 AC 955 ms
6,676 KB
testcase_05 AC 171 ms
6,676 KB
testcase_06 AC 541 ms
6,676 KB
testcase_07 AC 564 ms
6,676 KB
testcase_08 AC 597 ms
6,676 KB
testcase_09 AC 358 ms
6,676 KB
testcase_10 AC 491 ms
6,676 KB
testcase_11 AC 860 ms
6,676 KB
testcase_12 AC 583 ms
6,676 KB
testcase_13 AC 280 ms
6,676 KB
testcase_14 AC 596 ms
6,676 KB
testcase_15 AC 592 ms
6,676 KB
testcase_16 AC 645 ms
6,676 KB
testcase_17 AC 641 ms
6,676 KB
testcase_18 AC 742 ms
6,676 KB
testcase_19 AC 82 ms
6,676 KB
testcase_20 AC 689 ms
6,676 KB
testcase_21 AC 342 ms
6,676 KB
testcase_22 AC 621 ms
6,676 KB
testcase_23 AC 756 ms
6,676 KB
testcase_24 AC 864 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, M; cin >> N >> M;
  vector<int> A(N);

  for (int i = 0; i < M; i++) {
    int L, R; cin >> L >> R;
    A.at(N - L)++;
    if (N - R + 1 != N) A.at(N - R + 1)--;
  }

  for (int i = 1; i < N; i++) A.at(i) += A.at(i - 1);
  for (int i : A) cout << i << endl;
}
0