瑞士轮 60pt
作者:
jy9
,
2024-10-16 20:38:45
,
所有人可见
,
阅读 2
#include <iostream>
#include <algorithm>
using namespace std;
const int NUM = 1e5+10;
int n, R, Q;
struct node{
int id, s, q;
bool operator < (const node &p)const{
if(s != p.s)return s > p.s;
return id < p.id;
}
}a[NUM];
int main(){
cin >> n >> R >> Q;
for (int i = 1; i <= 2*n; i ++ ){
cin >> a[i].s;
a[i].id = i;
}
for (int i = 1; i <= 2*n; i ++ ){
cin >> a[i].q;
}
sort(a+1, a+1+2*n);
while (R--){
for(int i = 1; i <= n; i ++){
if(a[2*i-1].q < a[2*i].q) a[i*2].s++;
else a[i*2-1].s++;
}
sort(a+1, a+1+2*n);
}
cout << a[Q].id;
return 0;
}