#include "Alice.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int mod = 1000000007, N = 200005;
// 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().
vector<pair<int,int>> Alice(){
ll x = setN(5000);
vector<pair<int, int>> t;
for(int i = 1; i <= 5000; i++){
if(i == x)continue;
t.push_back({i, x});
}
return t;
}
#include "Bob.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int mod = 1000000007, N = 200005;
bool f[N+2];
// 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){
int mx = 0;
for(auto&[u, v] : V){
if(f[u])mx = u;
else mx = v;
f[u] |= 1;
f[v] |= 1;
}
return mx;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |