結果

問題 No.3039 配信者
ユーザー eiram
提出日時 2025-01-14 23:46:03
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
AC  
実行時間 475 ms / 2,000 ms
コード長 395 bytes
コンパイル時間 9,071 ms
コンパイル使用メモリ 254,188 KB
実行使用メモリ 14,976 KB
最終ジャッジ日時 2025-01-18 02:30:40
合計ジャッジ時間 11,410 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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