結果
問題 | No.3039 配信者 |
ユーザー |
|
提出日時 | 2025-02-28 21:43:24 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 229 ms / 2,000 ms |
コード長 | 439 bytes |
コンパイル時間 | 1,757 ms |
コンパイル使用メモリ | 191,020 KB |
実行使用メモリ | 7,528 KB |
最終ジャッジ日時 | 2025-02-28 21:43:30 |
合計ジャッジ時間 | 5,055 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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;}