結果

問題 No.2154 あさかつの参加人数
ユーザー umezoumezo
提出日時 2022-12-09 22:19:23
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 469 bytes
コンパイル時間 2,274 ms
コンパイル使用メモリ 196,072 KB
実行使用メモリ 9,088 KB
最終ジャッジ日時 2024-04-22 22:27:10
合計ジャッジ時間 7,952 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
8,960 KB
testcase_01 AC 123 ms
9,088 KB
testcase_02 AC 125 ms
8,960 KB
testcase_03 AC 120 ms
9,088 KB
testcase_04 AC 119 ms
9,088 KB
testcase_05 AC 60 ms
8,064 KB
testcase_06 AC 98 ms
8,832 KB
testcase_07 AC 61 ms
7,040 KB
testcase_08 AC 59 ms
6,940 KB
testcase_09 AC 20 ms
6,940 KB
testcase_10 AC 55 ms
6,944 KB
testcase_11 AC 104 ms
8,704 KB
testcase_12 AC 84 ms
7,936 KB
testcase_13 AC 51 ms
7,168 KB
testcase_14 AC 93 ms
8,448 KB
testcase_15 AC 54 ms
6,940 KB
testcase_16 AC 88 ms
8,064 KB
testcase_17 AC 101 ms
8,832 KB
testcase_18 AC 105 ms
8,704 KB
testcase_19 AC 9 ms
6,940 KB
testcase_20 AC 83 ms
7,808 KB
testcase_21 AC 17 ms
6,940 KB
testcase_22 AC 31 ms
6,944 KB
testcase_23 AC 99 ms
8,576 KB
testcase_24 AC 109 ms
8,704 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