Submission #344561

#TimeUsernameProblemLanguageResultExecution timeMemory
344561SeDunionXoractive (IZhO19_xoractive)C++17
0 / 100
5 ms620 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> 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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...