結果

問題 No.2154 あさかつの参加人数
ユーザー SSRSSSRS
提出日時 2022-12-09 21:36:18
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 974 ms / 2,000 ms
コード長 419 bytes
コンパイル時間 1,771 ms
コンパイル使用メモリ 165,220 KB
実行使用メモリ 9,216 KB
最終ジャッジ日時 2024-04-22 21:10:30
合計ジャッジ時間 22,311 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 974 ms
9,088 KB
testcase_01 AC 955 ms
9,216 KB
testcase_02 AC 966 ms
9,088 KB
testcase_03 AC 969 ms
9,088 KB
testcase_04 AC 961 ms
9,088 KB
testcase_05 AC 178 ms
6,940 KB
testcase_06 AC 555 ms
7,808 KB
testcase_07 AC 556 ms
6,940 KB
testcase_08 AC 616 ms
6,944 KB
testcase_09 AC 358 ms
6,940 KB
testcase_10 AC 501 ms
6,940 KB
testcase_11 AC 843 ms
8,320 KB
testcase_12 AC 599 ms
7,296 KB
testcase_13 AC 284 ms
6,940 KB
testcase_14 AC 610 ms
7,552 KB
testcase_15 AC 572 ms
6,940 KB
testcase_16 AC 663 ms
7,424 KB
testcase_17 AC 629 ms
7,936 KB
testcase_18 AC 758 ms
8,192 KB
testcase_19 AC 86 ms
6,944 KB
testcase_20 AC 699 ms
7,296 KB
testcase_21 AC 314 ms
6,940 KB
testcase_22 AC 627 ms
6,940 KB
testcase_23 AC 743 ms
7,936 KB
testcase_24 AC 849 ms
8,448 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N, M;
  cin >> N >> M;
  vector<int> L(M), R(M);
  for (int i = 0; i < M; i++){
    cin >> L[i] >> R[i];
    R[i]--;
  }
  vector<int> imos(N + 1, 0);
  for (int i = 0; i < M; i++){
    imos[R[i]]++;
    imos[L[i]]--;
  }
  for (int i = 0; i < N; i++){
    imos[i + 1] += imos[i];
  }
  for (int i = N - 1; i >= 0; i--){
    cout << imos[i] << endl;
  }
}
0