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 pb push_back
using namespace std;
int x;
vector<int> guess(int n) {
vector <int> ans;
for (int i = 1; i <= n; i++) {
if(i&1){
x = ask(i);
ans.pb(x);
}
else{
vector<int > in = get_pairwise_xor({i,i+1});
vector<int>same;
for(int i = 1;i<4;i++){
if(in[i] == in[i-1]) {
same.pb(in[i]);
}
}
if(same.size() == 1){
ans.pb(same[0] ^ (ans.back()));
}
else{
ans.pb(in[1]);
}
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |