結果
| 問題 |
No.3039 配信者
|
| ユーザー |
vjudge1
|
| 提出日時 | 2025-03-02 21:32:53 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 199 ms / 2,000 ms |
| コード長 | 439 bytes |
| コンパイル時間 | 1,877 ms |
| コンパイル使用メモリ | 191,932 KB |
| 実行使用メモリ | 8,604 KB |
| 最終ジャッジ日時 | 2025-03-02 21:32:59 |
| 合計ジャッジ時間 | 6,073 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 15 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:11:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
11 | scanf("%d%d",&n,&h);
| ~~~~~^~~~~~~~~~~~~~
main.cpp:15:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
15 | scanf("%d%d",&a,&b);
| ~~~~~^~~~~~~~~~~~~~
ソースコード
#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;
}
vjudge1