Submission #618710

#TimeUsernameProblemLanguageResultExecution timeMemory
618710HappyPacManXoractive (IZhO19_xoractive)C++14
100 / 100
15 ms1364 KiB
#include "interactive.h" #include <bits/stdc++.h> using namespace std; vector<int> guess(int n) { multiset<int> px[7]; for(int i=0;i<7;i++){ vector<int> gpx; for(int j=0;j<n;j++){ if(!(j & (1 << i))){ gpx.push_back(j+1); } } vector<int> qans = get_pairwise_xor(gpx); for(int it : qans){ px[i].insert(it); } } for(int i=0;i<7;i++){ vector<int> gpx; for(int j=1;j<n;j++){ if(!(j & (1 << i))){ gpx.push_back(j+1); } } vector<int> qans = get_pairwise_xor(gpx); for(int it : qans){ px[i].erase(px[i].lower_bound(it)); } } for(int i=0;i<7;i++){ px[i].erase(px[i].lower_bound(0)); } int fr = ask(1); set<int> numbers; for(int i=0;i<7;i++){ for(int it : px[i]){ numbers.insert(it^fr); } } map<int,int> mp; for(int i=0;i<7;i++){ for(int it : numbers){ if(!px[i].count(it^fr)){ mp[it] |= (1<<i); } } } vector<int> res(n); res[0] = fr; for(auto [u,v] : mp){ res[v] = u; } return res; }

Compilation message (stderr)

Xoractive.cpp: In function 'std::vector<int> guess(int)':
Xoractive.cpp:51:11: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   51 |  for(auto [u,v] : mp){
      |           ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...