#include <bits/stdc++.h>
#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().
vector <int> seedA;
int NA=5000-2;
void constructA(){
seedA.push_back(0);
seedA.push_back(0);
seedA.push_back(0);
for(int i=0;i<=60;i++){
int tms=NA/60;
if(NA%60!=0){
tms++;
NA--;
}
while(tms--){
seedA.push_back(i);
}
}
shuffle(seedA.begin()+3,seedA.end(),mt19937(246));
return;
}
vector<pair<int,int>> Alice(){
constructA();
long long x=setN(5000),n=5000;
vector <pair<int,int>> edges;
edges.push_back({1,2});
for(int i=3;i<=n;i++){
if(((1<<seedA[i])&x)==0){
edges.push_back({1,i});
}
else{
edges.push_back({2,i});
}
}
return edges;
}
#include <bits/stdc++.h>
#include "Bob.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().
vector <int> seedB;
int NB=5000-2;
void constructB(){
seedB.push_back(0);
seedB.push_back(0);
seedB.push_back(0);
for(int i=0;i<=60;i++){
int tms=NB/60;
if(NB%60!=0){
tms++;
NB--;
}
while(tms--){
seedB.push_back(i);
}
}
shuffle(seedB.begin()+3,seedB.end(),mt19937(246));
return;
}
int bt[61],key[5001];
long long Bob(std::vector<std::pair<int,int>> V){
constructB();
for(auto [a,b]:V){
if(a==2) bt[seedB[b]]=1;
}
long long x;
for(int i=0;i<=60;i++) x+=(1<<i)*bt[i];
return x; // change this into your code
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |