标签:
#include<cstdio>
#include<map>
using namespace std;
const int maxm = 1E5 * 2 + 10;
int a[maxm],b[maxm];
map<int,int> qm;
int main(){
int n,tmp,m;
scanf("%d",&n);
for(int i = 0 ; i < n ; ++i){
scanf("%d",&tmp);
if(qm.find(tmp) == qm.end()){
qm[tmp] = 1;
}else ++qm[tmp];
}
scanf("%d",&m);
for(int i = 0 ; i < m ; ++i){
scanf("%d",&a[i]);
}
for(int i = 0 ; i < m ; ++i){
scanf("%d",&b[i]);
}
int ans;
pair<int,int> cnt,cur;
cnt.first = cnt.second = -1;
for(int i = 0; i < m ; ++i){
cur = pair<int,int>(qm[a[i]],qm[b[i]]);
if( cnt < cur ){
cnt = cur;
ans = i;
}
}
printf("%d\n",ans + 1);
return 0;
}
[2016-05-06][codeforces][670C - Cinema]
标签:
原文地址:http://www.cnblogs.com/qhy285571052/p/5582f3709fd931f9c0b4e5172dbfbe99.html