結果

問題 No.2154 あさかつの参加人数
ユーザー umezoumezo
提出日時 2022-12-09 22:19:23
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 469 bytes
コンパイル時間 1,936 ms
コンパイル使用メモリ 200,024 KB
実行使用メモリ 8,912 KB
最終ジャッジ日時 2023-08-05 00:05:31
合計ジャッジ時間 8,393 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
8,852 KB
testcase_01 AC 124 ms
8,840 KB
testcase_02 AC 124 ms
8,800 KB
testcase_03 AC 123 ms
8,796 KB
testcase_04 AC 123 ms
8,912 KB
testcase_05 AC 59 ms
7,744 KB
testcase_06 AC 99 ms
8,524 KB
testcase_07 AC 63 ms
6,744 KB
testcase_08 AC 60 ms
6,420 KB
testcase_09 AC 21 ms
5,168 KB
testcase_10 AC 57 ms
6,808 KB
testcase_11 AC 107 ms
8,264 KB
testcase_12 AC 85 ms
7,796 KB
testcase_13 AC 52 ms
6,952 KB
testcase_14 AC 93 ms
8,392 KB
testcase_15 AC 56 ms
6,416 KB
testcase_16 AC 88 ms
7,860 KB
testcase_17 AC 102 ms
8,644 KB
testcase_18 AC 108 ms
8,652 KB
testcase_19 AC 10 ms
5,216 KB
testcase_20 AC 86 ms
7,532 KB
testcase_21 AC 18 ms
5,156 KB
testcase_22 AC 33 ms
5,104 KB
testcase_23 AC 100 ms
8,376 KB
testcase_24 AC 111 ms
8,588 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;

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

int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);

  int n,m;
  cin>>n>>m;
  vector<int> L(m),R(m);
  rep(i,m) cin>>L[i]>>R[i];
  
  vector<int> A(500500);
  rep(i,m){
    A[R[i]]++;
    A[L[i]+1]--;
  }
  for(int i=1;i<500500;i++) A[i]+=A[i-1];
  for(int i=n;i>0;i--) cout<<A[i]<<'\n';
  
  return 0;
}
0