Submission #729993

#TimeUsernameProblemLanguageResultExecution timeMemory
729993BaytoroUnscrambling a Messy Bug (IOI16_messy)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "grader.cpp" using namespace std; #define ll long long #define pb push_back #define fr first #define sc second //#include "messy.h" int N,W,R; vector<int> ans; void build1(int l, int r){ if(l==r) return; int md=(l+r)/2; string s(N,'1'); for(int i=l;i<=r;i++) s[i]='0'; for(int i=l;i<=md;i++){ s[i]='1'; add_element(s); s[i]='0'; } build1(l,md);build1(md+1,r); } void get(int l, int r, vector<int> v){ if(l==r){ ans[v[0]]=l;return; } int md=(l+r)/2; string s(N,'1'); for(auto it: v) s[it]='0'; vector<int> L,R; for(auto it: v){ s[it]='1'; if(check_element(s)) L.pb(it); else R.pb(it); s[it]='0'; } get(l,md,L);get(md+1,r,R); } vector<int> restore_permutation(int n, int w, int r) { N=n,W=w,R=r; ans.resize(N); build1(0,N-1); compile_set(); vector<int> v; for(int i=0;i<n;i++) v.pb(i); get(0,N-1,v); return ans; }

Compilation message (stderr)

/usr/bin/ld: /tmp/cc4hRrdX.o: in function `helper::read_int()':
grader.cpp:(.text+0x860): multiple definition of `helper::read_int()'; /tmp/cclJnApW.o:messy.cpp:(.text+0x920): first defined here
/usr/bin/ld: /tmp/cc4hRrdX.o: in function `get_p(int)':
grader.cpp:(.text+0x8b0): multiple definition of `get_p(int)'; /tmp/cclJnApW.o:messy.cpp:(.text+0x970): first defined here
/usr/bin/ld: /tmp/cc4hRrdX.o:(.bss+0x10): multiple definition of `helper::p'; /tmp/cclJnApW.o:(.bss+0x30): first defined here
/usr/bin/ld: /tmp/cc4hRrdX.o: in function `wa()':
grader.cpp:(.text+0x8d0): multiple definition of `wa()'; /tmp/cclJnApW.o:messy.cpp:(.text+0x990): first defined here
/usr/bin/ld: /tmp/cc4hRrdX.o: in function `check(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
grader.cpp:(.text+0x900): multiple definition of `check(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'; /tmp/cclJnApW.o:messy.cpp:(.text+0x9c0): first defined here
/usr/bin/ld: /tmp/cc4hRrdX.o:(.bss+0x28): multiple definition of `helper::n'; /tmp/cclJnApW.o:(.bss+0x48): first defined here
/usr/bin/ld: /tmp/cc4hRrdX.o: in function `check_element(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
grader.cpp:(.text+0x950): multiple definition of `check_element(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'; /tmp/cclJnApW.o:messy.cpp:(.text+0xa10): first defined here
/usr/bin/ld: /tmp/cc4hRrdX.o:(.bss+0x0): multiple definition of `helper::r'; /tmp/cclJnApW.o:(.bss+0x24): first defined here
/usr/bin/ld: /tmp/cc4hRrdX.o:(.bss+0x2c): multiple definition of `helper::compiled'; /tmp/cclJnApW.o:(.bss+0x4c): first defined here
/usr/bin/ld: /tmp/cc4hRrdX.o:(.bss+0x40): multiple definition of `helper::set_[abi:cxx11]'; /tmp/cclJnApW.o:(.bss+0x60): first defined here
/usr/bin/ld: /tmp/cc4hRrdX.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cclJnApW.o:messy.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/cc4hRrdX.o:(.bss+0x4): multiple definition of `helper::w'; /tmp/cclJnApW.o:(.bss+0x28): first defined here
/usr/bin/ld: /tmp/cc4hRrdX.o: in function `add_element(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
grader.cpp:(.text+0xad0): multiple definition of `add_element(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'; /tmp/cclJnApW.o:messy.cpp:(.text+0xb90): first defined here
/usr/bin/ld: /tmp/cc4hRrdX.o: in function `compile_set()':
grader.cpp:(.text+0xb30): multiple definition of `compile_set()'; /tmp/cclJnApW.o:messy.cpp:(.text+0xd60): first defined here
collect2: error: ld returned 1 exit status