結果

問題 No.2154 あさかつの参加人数
ユーザー umezoumezo
提出日時 2022-12-09 22:19:23
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
AC  
実行時間 134 ms / 2,000 ms
コード長 469 bytes
コンパイル時間 2,245 ms
コンパイル使用メモリ 202,236 KB
実行使用メモリ 9,088 KB
最終ジャッジ日時 2024-10-14 22:16:27
合計ジャッジ時間 8,483 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

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