結果
| 問題 | No.3039 配信者 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-02-28 21:43:24 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 135 ms / 2,000 ms |
| コード長 | 439 bytes |
| 記録 | |
| コンパイル時間 | 1,070 ms |
| コンパイル使用メモリ | 208,980 KB |
| 実行使用メモリ | 9,220 KB |
| 最終ジャッジ日時 | 2026-07-06 12:05:04 |
| 合計ジャッジ時間 | 4,372 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 15 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF=0x3f3f3f3f;
const ll LLINF=0x3f3f3f3f3f3f3f3fLL;
const int MAX=1e6+10;
int bit[MAX];
int main()
{
int n,h,i,a,b,ans;
scanf("%d%d",&n,&h);
for(i=0;i<=h;i++) bit[i]=0;
for(i=1;i<=n;i++)
{
scanf("%d%d",&a,&b);
bit[a]++;
bit[b+1]--;
}
ans=bit[0];
for(i=1;i<=h;i++)
{
bit[i]+=bit[i-1];
ans=max(ans,bit[i]);
}
printf("%d\n",ans);
return 0;
}