#include <vector>
#include "Alice.h"
using namespace std;
// you may define some global variables, but it does not work if you try to transfer any information from function Alice() to function Bob() through these variables.
// you had better not use the same global variables in function Alice() and in function Bob().
std::vector<std::pair<int,int>> Alice(){
// add your code here
// change below into your code
const int N = 5000;
long long x = setN(N);
std::vector<std::pair<int,int>> re;
for(int i = 1 ; i <= N ; i++){
if(i != x)re.emplace_back(i, x);
}
return re;
}
#include <vector>
#include <algorithm>
using namespace std;
#include "Bob.h"
// you may define some global variables, but it does not work if you try to transfer any information from function Alice() to function Bob() through these variables.
// you had better not use the same global variables in function Alice() and in function Bob().
long long Bob(std::vector<std::pair<int,int>> V){
// add your code here
std::vector<int> occ(5042, 0);
int m_occ = 0;
int val = -1;
for(auto p:V){
occ[p.first]++;
occ[p.second]++;
if(occ[p.first] > m_occ){
m_occ = occ[p.first];
val = p.first;
}
if(occ[p.second] > m_occ){
m_occ = occ[p.second];
val = p.second;
}
}
return val; // change this into your code
}