結果

問題 No.3039 配信者
ユーザー Hyoka7
提出日時 2025-02-28 21:45:10
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 738 ms / 2,000 ms
コード長 446 bytes
コンパイル時間 2,082 ms
コンパイル使用メモリ 193,012 KB
実行使用メモリ 6,988 KB
最終ジャッジ日時 2025-02-28 21:45:23
合計ジャッジ時間 9,852 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, a, b) for (int i = a; i < (b); ++i)

int main()
{
    int n, h;
    cin >> n >> h;
    vector<int> imos(h + 2);
    rep(_, 0, n)
    {
        int l, r;
        cin >> l >> r;
        imos[l]++;
        imos[r + 1]--;
    }
    int ans = 0, tmp = 0;
    rep(i, 0, h + 2)
    {
        tmp += imos[i];
        ans = max(ans, tmp);
    }
    cout << ans << endl;
}
0