#include <bits/stdc++.h>
#include "interactive.h"
// #include "grader.cpp"
#define ok puts("ok");
using namespace std;
vector <int> ans;
vector<int> guess(int n) {
map <int, int> ind;
ans.resize(n, ask(1));
for (int i = 0; i < 7; i++) {
vector <int> vec;
for (int j = 2; j <= n; j++) {
if ((j >> i) & 1) {
vec.push_back(j);
}
}
if (vec.empty()) continue;
vector <int> vv = vec;
vv.push_back(1);
vv = get_pairwise_xor(vv);
vec = get_pairwise_xor(vec);
map <int, int> cnt;
for (int to : vv) {
if (to != 0)
cnt[to]++;
}
for (int to : vec) {
if (to != 0)
cnt[to]--;
}
// cout << i << "# \n";
for (int to : vv) {
if (cnt[to] == 0) continue;
// cout << (to.first ^ ans[0]) << ' ' << to.second << endl;
ind[to ^ ans[0]] |= (1 << i);
}
}
for (auto to : ind) {
cout << to.first << ' ' << to.second << endl;
ans[to.second - 1] = to.first;
}
return ans;
}
/*
10
1 2 3 4 5 1 2 3 4 5
*/
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
248 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
7 ms |
376 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |