結果

問題 No.2154 あさかつの参加人数
ユーザー Cyclone28Cyclone28
提出日時 2022-12-14 12:11:45
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,014 ms / 2,000 ms
コード長 1,687 bytes
コンパイル時間 1,832 ms
コンパイル使用メモリ 165,012 KB
実行使用メモリ 7,320 KB
最終ジャッジ日時 2024-04-25 16:31:10
合計ジャッジ時間 24,578 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,014 ms
7,164 KB
testcase_01 AC 973 ms
7,244 KB
testcase_02 AC 955 ms
7,288 KB
testcase_03 AC 948 ms
7,320 KB
testcase_04 AC 980 ms
7,144 KB
testcase_05 AC 174 ms
6,944 KB
testcase_06 AC 561 ms
6,944 KB
testcase_07 AC 568 ms
6,944 KB
testcase_08 AC 621 ms
6,944 KB
testcase_09 AC 346 ms
6,940 KB
testcase_10 AC 506 ms
6,940 KB
testcase_11 AC 866 ms
6,940 KB
testcase_12 AC 609 ms
6,940 KB
testcase_13 AC 282 ms
6,940 KB
testcase_14 AC 634 ms
6,944 KB
testcase_15 AC 586 ms
6,940 KB
testcase_16 AC 685 ms
6,940 KB
testcase_17 AC 649 ms
6,940 KB
testcase_18 AC 761 ms
6,940 KB
testcase_19 AC 85 ms
6,944 KB
testcase_20 AC 710 ms
6,940 KB
testcase_21 AC 316 ms
6,944 KB
testcase_22 AC 621 ms
7,040 KB
testcase_23 AC 773 ms
6,944 KB
testcase_24 AC 884 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using ld = long double;
using ull = unsigned long long;
using uint = unsigned;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

template<class T> using pq = priority_queue<T, vector<T>, greater<T>>;

const int MOD = 1000000007;
const int MODD =  998244353;

const ll dx[] = {0, 1, 0, -1, 1, -1, 1, -1};
const ll dy[] = {1, 0, -1, 0, 1, 1, -1, -1};

#define overload4(_1, _2, _3, _4, name, ...) name
#define overload3(_1, _2, _3, name, ...) name
#define rep1(n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep3(i, a, b) for(ll i = (ll)(a); i < (ll)(b); i++)
#define rep4(i, a, b, c) for(ll i = (ll)(a); i < (ll)(b); i += (ll)(c))
#define rep(...) overload4(__VA_ARGS__, rep4, rep3, rep2, rep1)(__VA_ARGS__)
#define rrep1(n) for(ll i = (ll)(n); i > (ll)(0); i--)
#define rrep2(i, n) for(ll i = (ll)(n); i > (ll)(0); i--)
#define rrep3(i, a, b) for(ll i = (ll)(a); i > (ll)(b); i--)
#define rrep4(i, a, b, c) for(ll i = (ll)(a); i > (ll)(b); i -= (ll)(c))
#define rrep(...) overload4(__VA_ARGS__, rrep4, rrep3, rrep2, rrep1)(__VA_ARGS__)

#define all(v) v.begin(), v.end()
#define elif else if
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define stoi stoll

#define MIN(v) *min_element(all(v))
#define MAX(v) *max_element(all(v))

int main(){
  ll N, M; cin >> N >> M;
  vector<ll> ans(N+1);
  rep(M){
    ll L, R; cin >> L >> R;
    ans[N-L]++, ans[N-R+1]--;
    //cout << N-L << " " << N-R+1 << endl;
  }
  rep(N-1) ans[i+1] += ans[i];
  rep(N) cout << ans[i] << endl;
  return 0;
}
0