結果
| 問題 |
No.647 明太子
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-03-13 23:57:20 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 31 ms / 4,500 ms |
| コード長 | 917 bytes |
| コンパイル時間 | 1,818 ms |
| コンパイル使用メモリ | 169,184 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-27 02:50:47 |
| 合計ジャッジ時間 | 2,664 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 20 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}
int main(){
int n;
cin >>n;
vector<int> a(n),b(n);
rep(i,n) cin >>a[i] >>b[i];
int m;
cin >>m;
vector<int> x(m),y(m);
rep(i,m) cin >>x[i] >>y[i];
vector<int> ct(m);
rep(i,n){
rep(j,m) ct[j] += (x[j]<=a[i] && b[i]<=y[j]);
}
int M = *max_element(all(ct));
if(M==0) cout << 0 << endl;
else{
rep(i,m)if(ct[i]==M) cout << i+1 << endl;
}
return 0;
}