Submission #485172

#TimeUsernameProblemLanguageResultExecution timeMemory
485172MilosMilutinovicXoractive (IZhO19_xoractive)C++14
0 / 100
3 ms712 KiB
#include "interactive.h" #include <bits/stdc++.h> #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i)) #define fb(i,a,b) for(int (i) = (a); (i) >= (b); --(i)) #define ll long long using namespace std; map<int, int> mp; vector<int> guess(int n){ int x = ask(1); ff(i,0,5){ vector<int> niz; ff(j,1,n){ if((j-1)&(1<<i))niz.push_back(j); } auto q1 = get_pairwise_xor(niz); niz.push_back(1); auto q2 = get_pairwise_xor(niz); int sz = q1.size(); int j = 0; ff(i,0,q2.size()-1){ while(j < sz && q1[j] < q2[i])j++; if(j < sz && q1[j] == q2[i]){ mp[q2[i]] |= (1 << i); } } } vector<int> ans(n); ans[0] = x; for(auto x:mp)ans[x.second] = x.first; return ans; }

Compilation message (stderr)

Xoractive.cpp: In function 'std::vector<int> guess(int)':
Xoractive.cpp:3:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
    3 | #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
      |                           ^
Xoractive.cpp:12:2: note: in expansion of macro 'ff'
   12 |  ff(i,0,5){
      |  ^~
Xoractive.cpp:3:27: warning: unnecessary parentheses in declaration of 'j' [-Wparentheses]
    3 | #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
      |                           ^
Xoractive.cpp:14:3: note: in expansion of macro 'ff'
   14 |   ff(j,1,n){
      |   ^~
Xoractive.cpp:3:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
    3 | #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
      |                           ^
Xoractive.cpp:22:3: note: in expansion of macro 'ff'
   22 |   ff(i,0,q2.size()-1){
      |   ^~
Xoractive.cpp:3:42: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    3 | #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
      |                                      ~~~~^~~~~~
Xoractive.cpp:22:3: note: in expansion of macro 'ff'
   22 |   ff(i,0,q2.size()-1){
      |   ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...