#include "interactive.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> guess(int n) {
vector<int> ans(n);
ans[0] = ask(1);
map<int, int> li;
for(int lg = 0; lg <= 6; lg ++){
vector<int> v;
for(int j = 2; j <= n; j ++){
if(j & (1 << lg)) v.push_back(j);
}
if(v.empty()) continue;
vector<int> gtv = get_pairwise_xor(v);
v.push_back(1);
vector<int> gtvp = get_pairwise_xor(v);
map<int, int> mp;
for(int i : gtv) if(i) mp[i] --;
for(int i : gtvp) if(i) mp[i] ++;
for(auto i : mp){
int cr = (i.first ^ ans[0]);
li[cr] |= (1 << lg);
}
}
for(auto i : li){
ans[i.second - 1] = i.first;
}
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
208 KB |
Output is not correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
4 ms |
464 KB |
Output is not correct |
2 |
Halted |
0 ms |
0 KB |
- |