Submission #808670

#TimeUsernameProblemLanguageResultExecution timeMemory
808670ono_de206Unscrambling a Messy Bug (IOI16_messy)C++14
Compilation error
0 ms0 KiB
#include "messy.h" #include<bits/stdc++.h> using namespace std; #define in insert #define all(x) x.begin(),x.end() #define pb push_back #define eb emplace_back #define ff first #define ss second //#define int long long typedef long long ll; typedef vector<int> vi; typedef set<int> si; typedef multiset<int> msi; typedef pair<int, int> pii; typedef vector<pii> vpii; vector<int> ans; string str; void build(int l, int r) { if(l == r) { str[l] = '1'; add_element(str); str[l] = '0'; return; } int m = (l + r) >> 1; for(int i = l; i <= m; i++) { str[i] = '1'; add_element(str); str[i] = '0'; } for(int i = l; i <= m; i++) { str[i] = '1'; } build(m + 1, r); for(int i = l; i <= m; i++) { str[i] = '0'; } build(l, m); } void find(int l, int r, vector<int> a) { if(l == r) { ans[l] = a[0]; } vector<int> L, R; for(int i = l; i <= r; i++) { int x = a[i]; str[x] = '1'; if(check_element(str)) L.pb(x); else R.pb(x); } for(int x : L) { str[x] = '1'; } find(m + 1, r, R); for(int x : L) { str[x] = '0'; } find(l, m, L); } vector<int> restore_permutation(int n, int w, int r) { vector<int> a(n); iota(all(a), 0); ans.resize(n); str = string(n, '0'); build(0, n - 1); compile_set(); str = string(n, '0'); find(0, n - 1, a); return ans; }

Compilation message (stderr)

messy.cpp: In function 'void find(int, int, std::vector<int>)':
messy.cpp:60:7: error: 'm' was not declared in this scope
   60 |  find(m + 1, r, R);
      |       ^