Submission #392153

#TimeUsernameProblemLanguageResultExecution timeMemory
392153AugustinasJucasUnscrambling a Messy Bug (IOI16_messy)C++14
Compilation error
0 ms0 KiB
using namespace std;
#include <bits/stdc++.h>

vector<int> restore_permutation(int n, int w, int r) {
    string db = "";
    for(int i = 0; i < n; i++) db += '0';
    for(int i = 0; i < n; i++){
        db[i] = '1';
//        cout << "idedu " << db << endl;
        add_element(db);
    }
    compile_set();
    string kolKas(n, '0');
    vector<int> ret(n);
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            if(kolKas[j] == '1') continue;
            auto cp = kolKas;
            cp[j] = '1';
            bool yra = check_element(cp);
            if(yra){
                // tada i-asis bitas mapinasi i j
                ret[j] = i;
                kolKas = cp;
                break;
            }
        }
    }
//    cout << "ret = ["; for(auto x : ret) cout << x << " "; cout << "]\n";
    return ret;
}

Compilation message (stderr)

messy.cpp: In function 'std::vector<int> restore_permutation(int, int, int)':
messy.cpp:10:9: error: 'add_element' was not declared in this scope
   10 |         add_element(db);
      |         ^~~~~~~~~~~
messy.cpp:12:5: error: 'compile_set' was not declared in this scope
   12 |     compile_set();
      |     ^~~~~~~~~~~
messy.cpp:20:24: error: 'check_element' was not declared in this scope
   20 |             bool yra = check_element(cp);
      |                        ^~~~~~~~~~~~~