Submission #899146

#TimeUsernameProblemLanguageResultExecution timeMemory
899146d4xnXoractive (IZhO19_xoractive)C++17
100 / 100
4 ms772 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 ^ ans[0]; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...