結果

問題 No.3039 配信者
ユーザー eiram
提出日時 2025-01-15 00:25:06
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
AC  
実行時間 448 ms / 2,000 ms
コード長 395 bytes
コンパイル時間 7,586 ms
コンパイル使用メモリ 254,056 KB
実行使用メモリ 14,876 KB
最終ジャッジ日時 2025-01-18 02:31:08
合計ジャッジ時間 9,711 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
    int n,h;
    cin>>n>>h;
    vector<int> a(n),b(n);
    for(int i=0;i<n;i++) cin>>a[i]>>b[i];

    vector<int> imos(h+1);
    int ma=0;
    for(int i=0;i<n;i++){
        imos[a[i]]++;
        imos[b[i]+1]--;
    }

    int now=0;
    for(int i=0;i<=h;i++){
        now+=imos[i];
        ma=max(ma,now);
    }
    cout<<ma<<endl;
}
0