結果
問題 |
No.647 明太子
|
ユーザー |
![]() |
提出日時 | 2018-02-11 19:36:07 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 32 ms / 4,500 ms |
コード長 | 835 bytes |
コンパイル時間 | 633 ms |
コンパイル使用メモリ | 73,132 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-27 02:40:02 |
合計ジャッジ時間 | 1,609 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
ソースコード
#include<iostream> #include<vector> #include<algorithm> #include<cmath> #include<cstdio> #include<map> using namespace std; int main(){ long long N,M,A[10001],B[10001],x,y,num=0,count; vector<long long> ans; cin >> N; for(int i=0;i<N;i++){ cin >> A[i] >> B[i]; } cin >> M; for(long long j=1;j<=M;j++){ count = 0; cin >> x >> y; for(int i=0;i<N;i++){ if(A[i]>=x&&B[i]<=y){ count++; } } if(num==count&&count!=0){ ans.push_back(j); } else if(num < count){ num = count; ans.clear(); ans.push_back(j); } } if(ans.size()==0){ cout << 0; } for(int i=0;i<ans.size();i++){ cout << ans[i] << endl; } return 0; }