結果
問題 | No.2154 あさかつの参加人数 |
ユーザー | ゾビオ |
提出日時 | 2022-12-09 21:26:30 |
言語 | C++23 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 1,020 ms / 2,000 ms |
コード長 | 2,575 bytes |
コンパイル時間 | 5,938 ms |
コンパイル使用メモリ | 335,428 KB |
実行使用メモリ | 12,264 KB |
最終ジャッジ日時 | 2024-04-22 20:14:51 |
合計ジャッジ時間 | 26,763 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1,016 ms
12,052 KB |
testcase_01 | AC | 1,001 ms
11,540 KB |
testcase_02 | AC | 1,011 ms
12,176 KB |
testcase_03 | AC | 1,008 ms
11,544 KB |
testcase_04 | AC | 1,020 ms
11,672 KB |
testcase_05 | AC | 175 ms
6,940 KB |
testcase_06 | AC | 572 ms
7,096 KB |
testcase_07 | AC | 575 ms
10,000 KB |
testcase_08 | AC | 629 ms
11,160 KB |
testcase_09 | AC | 367 ms
10,200 KB |
testcase_10 | AC | 516 ms
10,396 KB |
testcase_11 | AC | 874 ms
12,264 KB |
testcase_12 | AC | 611 ms
10,540 KB |
testcase_13 | AC | 285 ms
6,940 KB |
testcase_14 | AC | 608 ms
10,156 KB |
testcase_15 | AC | 588 ms
10,888 KB |
testcase_16 | AC | 678 ms
10,868 KB |
testcase_17 | AC | 639 ms
9,608 KB |
testcase_18 | AC | 749 ms
11,356 KB |
testcase_19 | AC | 84 ms
6,944 KB |
testcase_20 | AC | 713 ms
10,852 KB |
testcase_21 | AC | 324 ms
7,292 KB |
testcase_22 | AC | 630 ms
11,640 KB |
testcase_23 | AC | 779 ms
11,688 KB |
testcase_24 | AC | 880 ms
11,176 KB |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> // AtCoder using namespace std; using namespace atcoder; // AtCoder using uint = unsigned int; using ll = long long; using ull = unsigned long long; using ld = long double; using mint = modint998244353; // AtCoder using vll = vector<long long>; using vvll = vector<vector<long long>>; using vvvll = vector<vector<vector<long long>>>; using vvvvll = vector<vector<vector<vector<long long>>>>; using vbl = vector<bool>; using vvbl = vector<vector<bool>>; using vvvbl = vector<vector<vector<bool>>>; using vvvvbl = vector<vector<vector<vector<bool>>>>; using dll = deque<long long>; using ddll = deque<deque<long long>>; using dddll = deque<deque<deque<long long>>>; using ddddll = deque<deque<deque<deque<long long>>>>; using pll = pair<long long, long long>; using vpll = vector<pair<long long, long long>>; using vvpll = vector<vector<pair<long long, long long>>>; #define rep(i, n) for (long long i = 0; i < n; i++) #define reps(i, n) for (long long i = 1; i <= n; i++) #define rrep(i, n) for (long long i = n - 1; i >= 0; i--) #define rreps(i, n) for (long long i = n; i >= 1; i--) #define reep(i, a, b) for (long long i = a; i < b; i++) #define all(a) (a).begin(), (a).end() #define rall(a) (a).rbegin(), (a).rend() #define PI acos(-1.0) #define YES printf("Yes\n"), exit(0) #define NO printf("No\n"), exit(0) constexpr long long MOD = 998244353LL; constexpr long long INF = (1LL << 60); template<class T> void setcout(T n) {cout << setprecision(n) << fixed;} template<class T> void arrcout(T &a) { for(size_t i = 0; i < a.size(); i++) cout << (i ? " " : "") << a.at(i); cout << endl; } template<class T> void arrcout2(T &a) { for(size_t i = 0; i < a.size(); i++) { for(size_t j = 0; j < a[i].size(); j++) cout << (j ? " " : "") << a.at(i).at(j); cout << endl;} } template<class... T> constexpr auto min(T... a){return min(initializer_list<common_type_t<T...>>{a...});} template<class... T> constexpr auto max(T... a){return max(initializer_list<common_type_t<T...>>{a...});} template<class T> bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; } template<class T> bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; } //#pragma GCC target("avx2") //#pragma GCC optimize("O3") //#pragma GCC optimize("unroll-loops") int main() { ll n, m; cin >> n >> m; vll imos(n + 1); rep(i, m) { ll l, r; cin >> l >> r; l--; r--; imos[r]++; imos[l + 1]--; } ll cur = 0; vll ans; rep(i, n) cur += imos[i], ans.push_back(cur); reverse(all(ans)); rep(i, n) cout << ans[i] << endl; }