Submission #886607

#TimeUsernameProblemLanguageResultExecution timeMemory
886607velislavgarkovUnscrambling a Messy Bug (IOI16_messy)C++14
Compilation error
0 ms0 KiB
#include <iostream> #include <vector> #include "messy.h" using namespace std; string sbeg, s1, cur; vector <int> curv, lef, ri; vector <int> ans; int n; void add_el(int l, int r) { if (l>=r) return; int mid=(l+r)/2; s1=sbeg; for (int i=l;i<=r;i++) s1[i]='0'; for (int i=l;i<=mid;i++) { cur=s1; cur[i]='1'; add_element(cur); } add_el(l,mid); add_el(mid+1,r); } void check_el(int l, int r, vector <int> v) { if (l==r) ans[l]=v[0]; if (l>=r) return; if (!lef.empty()) lef.clear(); if (!ri.empty()) ri.clear(); s1=sbeg; for (auto i:v) s1[i]='0'; for (auto i:v) { cur=s1; cur[i]='1'; if (check_element(cur)) { lef.push_back(i); } else { ri.push_back(i); } } int mid=(l+r)/2; check_el(l,mid,lef); check_el(mid+1,r,ri); } vector <int> restore_permutaion(int N, int w, int r) { ans.resize(N); n=N; for (int i=0;i<n;i++) { sbeg+='1'; cur+='1'; } add_el(0,n-1); compile_set(); for (int i=0;i<n;i++) curv.push_back(i); check_el(0,n-1,curv); return ans; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccPJrlrL.o: in function `main':
grader.cpp:(.text.startup+0x1b4): undefined reference to `restore_permutation(int, int, int)'
collect2: error: ld returned 1 exit status