結果
問題 |
No.2154 あさかつの参加人数
|
ユーザー |
![]() |
提出日時 | 2023-09-24 13:23:23 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 737 ms / 2,000 ms |
コード長 | 647 bytes |
コンパイル時間 | 1,898 ms |
コンパイル使用メモリ | 195,332 KB |
最終ジャッジ日時 | 2025-02-17 02:06:11 |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
ソースコード
#include <bits/stdc++.h> #include<iostream> #include<map> #include<vector> #include <algorithm> #include<math.h> #include <iomanip> #include<set> #include <numeric> #include<string> using ll = long long; using namespace std; int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); ll n, m; cin >> n >> m; vector<ll> d(n), sum(n); for (int i = 0; i < m; i++){ int be, end; cin >> be >> end; d[n-be]++; if (end != 1) d[n- end + 1]--; } for (int i = 0; i < n; i++){ sum[i] += d[i]; if (i) sum[i] += sum[i-1]; cout << sum[i] << endl; } }