# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
618703 | Je_O | Xoractive (IZhO19_xoractive) | C++17 | 5 ms | 424 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "interactive.h"
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
const int N = 105;
map<int, int> pos;
map<int, int> cnt;
vector<int> guess(int n){
vector<int> ans;
for(int i = 0; i < n; ++i)ans.pb(0);
ans[0] = ask(1);
for(int i = 0; i <= 6; i++){
vector<int> v;
for(int j = 2; j <= n; ++j){
if(j & (1 << i))v.pb(j);
}
vector<int> v1 = get_pairwise_xor(v);
v.pb(1);
vector<int> v2 = get_pairwise_xor(v);
cnt.clear();
for(int j = 0; j < v1.size(); ++j)cnt[v1[j]]--;
for(int j = 0; j < v2.size(); ++j)cnt[v2[j]]++;
for(auto it = cnt.begin(); it != cnt.end(); ++it){
if(it->se == 0 || it->fi == 0)continue;
pos[(it->fi) ^ ans[0]] |= (1 << i);
}
}
for(auto it = pos.begin(); it != pos.end(); ++it){
ans[it->se - 1] = it->fi;
}
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |