#include <bits/stdc++.h>
using namespace std;
#include "interactive.h"
// ask(i) := returns value at i
// get_pairwise_xor(vec) := returns a set of pairwise xor's
map<int, int> loc;
vector<int> guess(int n){
int lst = ask(n);
for(int bt = 0; bt < 7; bt++){
vector<int> vec;
for(int i = 0; i < n - 1; i++)
if(i & (1 << bt)) vec.push_back(i + 1);
vector<int> st = get_pairwise_xor(vec);
vec.push_back(n);
vector<int> fn = get_pairwise_xor(vec);
vector<int> vals;
for(int i = 0, j = 0; i < (int) st.size(); i++, j++){
while(j < (int) fn.size() && fn[j] != st[i]) vals.push_back(fn[j++]);
}
for(int j = 1; j < (int) st.size(); j++) loc[st[j]] ^= 1 << bt;
}
vector<int> ans;
ans.resize(n, 0);
for(auto x : loc) ans[x.second] = x.first;
ans[n - 1] = lst;
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
208 KB |
Not correct size |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
464 KB |
Output is not correct |
2 |
Halted |
0 ms |
0 KB |
- |