結果

問題 No.2154 あさかつの参加人数
ユーザー SSRSSSRS
提出日時 2022-12-09 21:36:18
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 932 ms / 2,000 ms
コード長 419 bytes
コンパイル時間 2,220 ms
コンパイル使用メモリ 165,632 KB
実行使用メモリ 8,980 KB
最終ジャッジ日時 2023-08-04 22:50:40
合計ジャッジ時間 22,037 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 915 ms
8,792 KB
testcase_01 AC 932 ms
8,848 KB
testcase_02 AC 931 ms
8,980 KB
testcase_03 AC 922 ms
8,952 KB
testcase_04 AC 912 ms
8,972 KB
testcase_05 AC 159 ms
5,936 KB
testcase_06 AC 516 ms
7,800 KB
testcase_07 AC 530 ms
6,280 KB
testcase_08 AC 579 ms
6,080 KB
testcase_09 AC 350 ms
4,380 KB
testcase_10 AC 481 ms
5,624 KB
testcase_11 AC 802 ms
8,000 KB
testcase_12 AC 563 ms
7,016 KB
testcase_13 AC 265 ms
5,492 KB
testcase_14 AC 572 ms
7,264 KB
testcase_15 AC 551 ms
5,940 KB
testcase_16 AC 637 ms
7,404 KB
testcase_17 AC 588 ms
7,912 KB
testcase_18 AC 710 ms
8,336 KB
testcase_19 AC 80 ms
4,380 KB
testcase_20 AC 661 ms
7,008 KB
testcase_21 AC 319 ms
4,400 KB
testcase_22 AC 628 ms
5,420 KB
testcase_23 AC 700 ms
7,808 KB
testcase_24 AC 812 ms
8,260 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