結果
問題 |
No.2154 あさかつの参加人数
|
ユーザー |
|
提出日時 | 2024-03-19 13:02:56 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 1,025 ms / 2,000 ms |
コード長 | 364 bytes |
コンパイル時間 | 4,560 ms |
コンパイル使用メモリ | 250,552 KB |
最終ジャッジ日時 | 2025-02-20 07:35:35 |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; using ll = long long; int N, M; ll A[505050]; int main() { cin >> N >> M; for (int i = 1; i <= M; i++) { int L, R; cin >> L >> R; A[L]++; A[R - 1]--; } for (int i = N; i >= 1; i--) { cout << A[i] << endl; A[i - 1] += A[i]; } return 0; }