結果

問題 No.2154 あさかつの参加人数
ユーザー れいん
提出日時 2025-05-08 18:26:46
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 383 ms / 2,000 ms
コード長 359 bytes
コンパイル時間 3,562 ms
コンパイル使用メモリ 275,716 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-05-08 18:27:03
合計ジャッジ時間 15,302 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main()
{
    int N, M;
    cin >> N >> M;
    vector<int> A(N + 1);
    for (int i = 0; i < M; i++)
    {
        int L, R;
        cin >> L >> R;
        A[N - L]++;
        A[N - R + 1]--;
    }
    int ans = 0;
    for (int i = 0; i < N; i++)
    {
        ans += A[i];
        cout << ans<< "\n";
    }
}
0