結果

問題 No.3039 配信者
ユーザー karinohito
提出日時 2025-03-31 21:30:12
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 184 ms / 2,000 ms
コード長 381 bytes
コンパイル時間 3,498 ms
コンパイル使用メモリ 272,764 KB
実行使用メモリ 7,324 KB
最終ジャッジ日時 2025-03-31 21:30:20
合計ジャッジ時間 7,027 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int P[1000002];
void solve(){
	int N,H,A,B;cin>>N>>H;
	for(int i=0;i<N;i++){
		cin>>A>>B;
		P[A]++;
		P[B+1]--;
	}
	ll bn=0,an=0;
	for(int t=0;t<=H;t++){
		bn+=P[t];
		an=max(an,bn);
	}
	cout<<an<<endl;

}

int main(){
	
	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	int T=1;
	// cin>>T;
	while(T--)solve();
}
0