結果

問題 No.2154 あさかつの参加人数
ユーザー watasou1543watasou1543
提出日時 2022-12-10 14:04:14
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,806 ms / 2,000 ms
コード長 2,636 bytes
コンパイル時間 1,959 ms
コンパイル使用メモリ 177,920 KB
実行使用メモリ 32,640 KB
最終ジャッジ日時 2024-04-22 23:46:51
合計ジャッジ時間 35,050 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,806 ms
32,640 KB
testcase_01 AC 1,791 ms
32,512 KB
testcase_02 AC 1,749 ms
32,640 KB
testcase_03 AC 1,805 ms
32,640 KB
testcase_04 AC 1,797 ms
32,640 KB
testcase_05 AC 249 ms
6,400 KB
testcase_06 AC 1,136 ms
17,536 KB
testcase_07 AC 889 ms
21,248 KB
testcase_08 AC 921 ms
23,552 KB
testcase_09 AC 451 ms
16,768 KB
testcase_10 AC 776 ms
19,456 KB
testcase_11 AC 1,512 ms
29,312 KB
testcase_12 AC 1,026 ms
20,736 KB
testcase_13 AC 457 ms
10,752 KB
testcase_14 AC 1,118 ms
20,224 KB
testcase_15 AC 866 ms
22,528 KB
testcase_16 AC 1,160 ms
22,912 KB
testcase_17 AC 1,185 ms
20,480 KB
testcase_18 AC 1,393 ms
25,216 KB
testcase_19 AC 106 ms
6,144 KB
testcase_20 AC 1,215 ms
25,088 KB
testcase_21 AC 389 ms
15,360 KB
testcase_22 AC 770 ms
27,008 KB
testcase_23 AC 1,355 ms
25,344 KB
testcase_24 AC 1,567 ms
28,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma region watasou
/*
.   ∧_∧ がばっ              寝る!
   ( ・ω・) 
  _| ⊃/(___     <⌒/ヽ-、___
/ └-(____/     /<_/____/
 ̄ ̄ ̄ ̄ ̄ ̄ ̄

the pen is mightier than the sword.
                        -エドワード・ブルワー=リットン-
KCLC44TH watasou1543 ver.2.0.
*/
#include <bits/stdc++.h>
using namespace std;
//マクロ宣言
#define rep(i, a, b) for (int i = a; i < b; i++)
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
using Graph = vector<vector<int>>;
using V = vector<int>;
using I = int;
ll mod=998244353;
string Y = "Yes";
string N = "No";
#define gcd __gcd
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define fi first
#define se second
#define fix(n) fixed << setprecision(n)
#define print(n) cout << n << endl
#define input(n) cin >> n
//関数宣言
template <typename T>
inline bool chmax(T &a, T b) { return ((a < b) ? (a = b, true) : (false)); }
template <typename T>
inline bool chmin(T &a, T b) { return ((a > b) ? (a = b, true) : (false)); }
ll jou(ll N,ll k){
  ll i=0;
  ll p=N;
  ll Ans=0;
  while(k>=(1<<i)){
    if(k&(1<<i)){
      Ans+=p;
    }
    p*=p;
    i++;
  }
  return Ans;
}
// 深さ優先探索
vector<bool> seen;
void dfs(const Graph &G, int v) {
    seen[v] = true; // v を訪問済にする

    // v から行ける各頂点 next_v について
    for (auto next_v : G[v]) {
        if (seen[next_v]) continue; // next_v が探索済だったらスルー
        dfs(G, next_v); // 再帰的に探索
    }
}
vector<pair<long long, long long> > pri(long long N) {
    vector<pair<long long, long long> > res;
    for (long long a = 2; a * a <= N; ++a) {
        if (N % a != 0) continue;
        long long ex = 0; // 指数

        // 割れる限り割り続ける
        while (N % a == 0) {
            ++ex;
            N /= a;
        }

        // その結果を push
        res.push_back({a, ex});
    }

    // 最後に残った数について
    if (N != 1) res.push_back({N, 1});
    return res;
}
//-------------------------------------------------------------------------
#pragma endregion watasou
int main(){
  int n,m;
  cin >> n >> m;
  V l(m),r(m);
  rep(i,0,m){
	cin >> l[i] >> r[i];
  }
  map<int,int>mp;
  V imos(n,0);
  rep(i,0,m){
	mp[l[i]]--;
	mp[r[i]-1]++;
  }
  imos[0]=mp[0];
  rep(i,1,n){
    imos[i]=imos[i-1]+mp[i];
  }
  reverse(all(imos));
  rep(i,0,n){
	cout << imos[i] << endl;
  }
}
0