Submission #182079

#TimeUsernameProblemLanguageResultExecution timeMemory
182079stefdascaXoractive (IZhO19_xoractive)C++14
0 / 100
6 ms376 KiB
#include "interactive.h" #include<bits/stdc++.h> using namespace std; int n, sol[102]; vector<int> guess(int n) { sol[1] = ask(1); map<int, int> ind; for(int i = 0; i <= 6; ++i) { vector<int> vec; for(int j = 2; j <= n; ++j) if(j & (1<<i)) vec.push_back(j); if(vec.empty()) continue; vector<int> vv = vec; vv.push_back(1); vv = get_pairwise_xor(vv); vec = get_pairwise_xor(vec); map<int, int> frq; for(int j = 0; j < vv.size(); ++j) if(vv[j] != 0) frq[vv[j]]++; for(int j = 0; j < vec.size(); ++j) if(vv[j] != 0) frq[vv[j]]--; for(int j = 0; j < vv.size(); ++j) if(frq[vv[j]] != 0) ind[(vv[j] ^ sol[1])] |= (1<<i); } for(auto poz : ind) sol[poz.second] = poz.first; vector<int> ans; for(int i = 1; i <= n; ++i) ans.push_back(sol[i]); return ans; }

Compilation message (stderr)

Xoractive.cpp: In function 'std::vector<int> guess(int)':
Xoractive.cpp:23:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int j = 0; j < vv.size(); ++j)
                        ~~^~~~~~~~~~~
Xoractive.cpp:26:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int j = 0; j < vec.size(); ++j)
                        ~~^~~~~~~~~~~~
Xoractive.cpp:29:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int j = 0; j < vv.size(); ++j)
                        ~~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...