Submission #337774

#TimeUsernameProblemLanguageResultExecution timeMemory
337774tengiz05Xoractive (IZhO19_xoractive)C++17
Compilation error
0 ms0 KiB
#include "interactive.h" #include "grader.cpp" #include <bits/stdc++.h> #define pb push_back using namespace std; int msb(int val){return sizeof(int)*8-__builtin_clz(val)-1;} vector<int> guess(int n) { vector <int> ans(n); vector<multiset<int>> v(8); vector<multiset<int>> o(8); ans[0] = ask(1); for(int j=0;j<7;j++){ vector<int> todo; for(int i=2;i<=n;i++){ if(i&(1<<j))todo.pb(i); }if(todo.empty())continue; vector<int> tmp = get_pairwise_xor(todo); for(auto x : tmp){ v[j].insert(x); }todo.pb(1); tmp = get_pairwise_xor(todo); for(auto x : tmp){ o[j].insert(x); } } for(int i=0;i<7;i++){ for(auto x : v[i]){ o[i].erase(o[i].find(x)); } } for(int i=2;i<=n;i++){ multiset<int> res; for(auto x : o[msb(i)])res.insert(x); for(int j=0;j<msb(i);j++){ if(i&(1<<j)){ vector<int> toerase; for(auto x : res)if(o[j].find(x) == o[j].end())toerase.pb(x); for(auto x : toerase)res.erase(res.find(x)); }else { for(auto x : o[j]){ if(res.find(x) != res.end())res.erase(res.find(x)); } } } assert(res.size()); ans[i-1] = (*res.rbegin())^ans[0]; } return ans; }

Compilation message (stderr)

/tmp/ccO0aqU0.o: In function `query()':
grader.cpp:(.text+0x30): multiple definition of `query()'
/tmp/cc3tcn1I.o:Xoractive.cpp:(.text+0x30): first defined here
/tmp/ccO0aqU0.o: In function `ask(int)':
grader.cpp:(.text+0x60): multiple definition of `ask(int)'
/tmp/cc3tcn1I.o:Xoractive.cpp:(.text+0x60): first defined here
/tmp/ccO0aqU0.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/cc3tcn1I.o:Xoractive.cpp:(.text.startup+0x0): first defined here
/tmp/ccO0aqU0.o: In function `get_pairwise_xor(std::vector<int, std::allocator<int> >)':
grader.cpp:(.text+0xc0): multiple definition of `get_pairwise_xor(std::vector<int, std::allocator<int> >)'
/tmp/cc3tcn1I.o:Xoractive.cpp:(.text+0xd0): first defined here
collect2: error: ld returned 1 exit status