Submission #541598

#TimeUsernameProblemLanguageResultExecution timeMemory
541598status_codingUnscrambling a Messy Bug (IOI16_messy)C++14
Compilation error
0 ms0 KiB
#include "messy.h" #include <bits/stdc++.h> using namespace std; string s; void genQuery(int st, int dr) { int mij=(st+dr)/2; for(int i=st;i<=mij;i++) { s[i]='1'; add_element(s); s[i]='0'; } for(int i=mij+1;i<=dr;i++) s[i]='1'; genQuery(st, mij); for(int i=mij+1;i<=dr;i++) s[i]='0'; for(int i=st;i<=mij;i++) s[i]='1'; genQuery(mij+1, dr); } void genAns(int st, int dr) { } vector<int> restore_permutation(int n, int w, int r) { s.resize(n); ans.resize(n); for(int i=0;i<n;i++) s[i]='0'; genQuery(0, n-1); compile_set(); for(int i=0;i<n;i++) s[i]='0'; genAns(0, n-1); return ans; }

Compilation message (stderr)

messy.cpp: In function 'std::vector<int> restore_permutation(int, int, int)':
messy.cpp:40:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   40 |     ans.resize(n);
      |     ^~~
      |     abs