Submission #1121933

#TimeUsernameProblemLanguageResultExecution timeMemory
1121933ElayV13Unscrambling a Messy Bug (IOI16_messy)C++17
Compilation error
0 ms0 KiB
#include "messy.h" #include <bits/stdc++.h> using namespace std; std::vector<int> restore_permutation(int n, int w, int r) { vector < string > s; for(int i = 0;i < n - 1;i++) { string q = ""; for(int j = 0;j <= i;j++) q = q + '0'; for(int j = i + 1;j < n;j++) q = q + '1'; s.push_back(q); add_element(q); } compile_set(); for(int i = 0;i < n;i++) for(int j = i;j < n;j++){ bool f = 1; for(int p = 0;p < n - 1;p++){ string q = s[p]; swap(q[i] , q[j]); f &= check_element(q); } if(ok){ vector < int > ans(n); for(int p = 0;p < n;p++) ans[p] = p; swap(ans[i] , ans[j]); return ans; } } }

Compilation message (stderr)

messy.cpp: In function 'std::vector<int> restore_permutation(int, int, int)':
messy.cpp:23:10: error: 'ok' was not declared in this scope
   23 |       if(ok){
      |          ^~
messy.cpp:6:22: warning: control reaches end of non-void function [-Wreturn-type]
    6 |    vector < string > s;
      |                      ^