Submission #67584

#TimeUsernameProblemLanguageResultExecution timeMemory
67584mirbek01Unscrambling a Messy Bug (IOI16_messy)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "messy.h" #include "grader.cpp" using namespace std; string s; vector <int> ans, vv; void fun(int l, int r){ if(l >= r) return ; s = ""; for(int i = 0; i < n; i ++){ if(l <= i && i <= r) s += '0'; else s += '1'; } int md = (l + r) >> 1; for(int i = l; i <= md; i ++){ s[i] = '1'; add_element(s); s[i] = '0'; } fun(l, md); fun(md + 1, r); } void rec(int l, int r){ if(l >= r){ return ; } s.resize(n); for(int i = 0; i < n; i ++){ if(l <= i && i <= r) s[ans[i]] = '0'; else s[ans[i]] = '1'; } vector < int > v1, v2; int md = (l + r) >> 1; for(int i = l; i <= r; i ++){ s[ans[i]] = '1'; if(check_element(s)) v1.push_back(ans[i]); else v2.push_back(ans[i]); s[ans[i]] = '0'; } int p1 = 0, p2 = 0; for(int i = l; i <= r; i ++){ if(i <= md){ ans[i] = v1[p1 ++]; } else { ans[i] = v2[p2 ++]; } } rec(l, md); rec(md + 1, r); } vector<int> restore_permutation(int NN, int w, int r) { ans.resize(n); vv.resize(n); for(int i = 0; i < n; i ++) ans[i] = i; fun(0, n - 1); compile_set(); rec(0, n - 1); for(int i = 0; i < n; i ++){ vv[ans[i]] = i; } return vv; }

Compilation message (stderr)

/tmp/ccfOtd3U.o: In function `helper::read_int()':
grader.cpp:(.text+0xf0): multiple definition of `helper::read_int()'
/tmp/cca41umN.o:messy.cpp:(.text+0x140): first defined here
/tmp/ccfOtd3U.o: In function `get_p(int)':
grader.cpp:(.text+0x140): multiple definition of `get_p(int)'
/tmp/cca41umN.o:messy.cpp:(.text+0x190): first defined here
/tmp/ccfOtd3U.o:(.bss+0x10): multiple definition of `helper::p'
/tmp/cca41umN.o:(.bss+0x70): first defined here
/tmp/ccfOtd3U.o: In function `wa()':
grader.cpp:(.text+0x160): multiple definition of `wa()'
/tmp/cca41umN.o:messy.cpp:(.text+0x1b0): first defined here
/tmp/ccfOtd3U.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/cca41umN.o:messy.cpp:(.text.startup+0x0): first defined here
/tmp/ccfOtd3U.o:(.bss+0x28): multiple definition of `helper::n'
/tmp/cca41umN.o:(.bss+0x88): first defined here
/tmp/ccfOtd3U.o:(.bss+0x4): multiple definition of `helper::w'
/tmp/cca41umN.o:(.bss+0x64): first defined here
/tmp/ccfOtd3U.o:(.bss+0x0): multiple definition of `helper::r'
/tmp/cca41umN.o:(.bss+0x60): first defined here
/tmp/ccfOtd3U.o:(.bss+0x2c): multiple definition of `helper::compiled'
/tmp/cca41umN.o:(.bss+0x8c): first defined here
/tmp/ccfOtd3U.o: In function `check(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
grader.cpp:(.text+0x190): multiple definition of `check(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/tmp/cca41umN.o:messy.cpp:(.text+0x1e0): first defined here
/tmp/ccfOtd3U.o: In function `check_element(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
grader.cpp:(.text+0x1f0): multiple definition of `check_element(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
/tmp/cca41umN.o:messy.cpp:(.text+0x240): first defined here
/tmp/ccfOtd3U.o:(.bss+0x40): multiple definition of `helper::set_[abi:cxx11]'
/tmp/cca41umN.o:(.bss+0xa0): first defined here
/tmp/ccfOtd3U.o: In function `add_element(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
grader.cpp:(.text+0x360): multiple definition of `add_element(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
/tmp/cca41umN.o:messy.cpp:(.text+0x3b0): first defined here
/tmp/ccfOtd3U.o: In function `compile_set()':
grader.cpp:(.text+0x3d0): multiple definition of `compile_set()'
/tmp/cca41umN.o:messy.cpp:(.text+0x420): first defined here
collect2: error: ld returned 1 exit status