#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> d;
for (int i = 0 ; (1 << i) <= n ; ++ i) {
vector<int> p;
for (int j = 2 ; j <= n ; ++ j) {
if (j >> i & 1) {
p.push_back(j);
}
}
auto p1 = get_pairwise_xor(p);
p.push_back(1);
auto p2 = get_pairwise_xor(p);
map<int,int> mp;
for (int i : p1) mp[i]++;
for (int i : p2) mp[i]--;
for (auto [i, j] : mp) if (j != 0) {
d[i] |= (1 << i);
}
}
for (auto [i, j] : d) {
ans[j - 1] = i;
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
492 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
5 ms |
620 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |