Submission #949623

#TimeUsernameProblemLanguageResultExecution timeMemory
949623PikachuXoractive (IZhO19_xoractive)C++17
100 / 100
4 ms600 KiB
#include <bits/stdc++.h> #include "interactive.h" #define bit(x, y) (((x) >> (y)) & 1) using namespace std; vector<int> guess(int n) { map<int,int> pos; vector<int> res(n); res[0] = ask(1); for (int b = 0; b < 7; b++) { vector<int> tmp; for (int i = 2; i <= n; i++) { if (bit(i, b)) tmp.push_back(i); } if (tmp.empty()) break; vector<int> mim = get_pairwise_xor(tmp); tmp.push_back(1); vector<int> mim1 = get_pairwise_xor(tmp); map<int,int> mp; for (int x : mim1) mp[x]++; for (int x : mim) mp[x]--; for (pair<int,int> p : mp) { if (p.first && p.second) pos[p.first ^ res[0]] |= (1 << b); } } for (pair<int,int> p : pos) { res[p.second - 1] = p.first; } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...