#include "Alice.h"
#include "bits/stdc++.h"
#define F first
#define S second
#define ll long long
#define pii pair<int,int>
const int mxN = 2e5 + 5;
const int mod = 1e9 + 7;
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<pair<int,int>> Alice(){
ll x = setN(5000);
vector<ll>idx;
for(int i = 1;i <= 5000;i++){
idx.push_back(i / 83);
}
shuffle(idx.begin(),idx.end(),mt19937(234));
vector<pii>v = {{1,2},{1,3}};
for(int i = 4;i <= 5000;i++){
if((x & (1LL << (idx[i - 1])))) v.push_back({2,i});
else v.push_back({3,i});
}
return v;
}
#include "Bob.h"
#include "bits/stdc++.h"
#define F first
#define S second
#define ll long long
#define pii pair<ll,ll>
const int mxN = 2e5 + 5;
const int mod = 1e9 + 7;
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().
ll Bob(vector<pair<int,int>> V){
vector<ll>idx;
vector<ll>v[4];
for(int i = 1;i <= 5000;i++){
idx.push_back(i / 83);
}
shuffle(idx.begin(),idx.end(),mt19937(234));
for(auto x : V){
if(x.F == 3 || x.F == 2) v[x.F].push_back(x.S);
}
ll st = 2;
if(v[2].size() < v[3].size()) st = 3;
ll ans = 0;
if(st == 3) ans = (1LL << 61) - 1;
for(auto x : v[st]){
ans += (1LL << idx[x - 1]) * (st == 2 ? 1 : -1);
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |