Submission #970631

#TimeUsernameProblemLanguageResultExecution timeMemory
970631pedroslreyXoractive (IZhO19_xoractive)C++17
100 / 100
3 ms600 KiB
#include "interactive.h" #include <bits/stdc++.h> using namespace std; vector<int> guess(int n) { unordered_map<int, int> mp; for (int k = 0; k < 7; ++k) { vector<int> xs; for (int i = 1; i < n; ++i) if (i & (1 << k)) xs.push_back(i); if (xs.empty()) continue; auto small = get_pairwise_xor(xs); xs.push_back(n); auto large = get_pairwise_xor(xs); for (int x: small) large.erase(lower_bound(large.begin(), large.end(), x)); for (int x: large) mp[x] |= 1 << k; } int x = ask(n); vector<int> xs(n); for (auto [k, v]: mp) if (k != 0) xs[v-1] = k ^ x; xs.back() = x; return xs; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...