結果
問題 |
No.2154 あさかつの参加人数
|
ユーザー |
|
提出日時 | 2022-12-10 16:45:01 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 153 ms / 2,000 ms |
コード長 | 570 bytes |
コンパイル時間 | 2,003 ms |
コンパイル使用メモリ | 193,736 KB |
最終ジャッジ日時 | 2025-02-09 09:12:20 |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
ソースコード
#include <bits/stdc++.h> using namespace std; #ifdef _RUTHEN #include <debug.hpp> #else #define show(...) true #endif using ll = long long; #define rep(i, n) for (int i = 0; i < (n); i++) template <class T> using V = vector<T>; int main() { ios::sync_with_stdio(false); cin.tie(0); int N, M; cin >> N >> M; V<int> imos(N + 1); rep(i, M) { int l, r; cin >> r >> l; imos[l - 1]++; imos[r]--; } rep(i, N) imos[i + 1] += imos[i]; for (int i = N - 1; i >= 0; i--) cout << imos[i] << '\n'; return 0; }