Submission #899144

#TimeUsernameProblemLanguageResultExecution timeMemory
899144d4xnXoractive (IZhO19_xoractive)C++17
0 / 100
3 ms344 KiB
#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> mp; for (int bt = 0; bt < 7; bt++) { vector<int> a; for (int i = 2; i <= n; i++) { if ((i >> bt) & 1) a.push_back(i); } vector<int> b; if (!a.empty()) b = get_pairwise_xor(a); a.push_back(1); vector<int> c = get_pairwise_xor(a); map<int, int> cnt; for (int& j : b) { cnt[j]--; } for (int& j : c) { cnt[j]++; } for (auto& [x, y] : cnt) { if (!y) continue; mp[x] += (1 << bt); } } for (auto& [x, y] : mp) { ans[y-1] = x; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...