Submission #591333

#TimeUsernameProblemLanguageResultExecution timeMemory
591333VanillaPaint By Numbers (IOI16_paint)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include "messy.h"
#include <vector>
using namespace std;

vector<int> restore_permutation(int n, int w, int r) {
    vector <int> p;
    for (int i = 0; i < 8; i++){
        p.push_back(i);
    }
    string s = "";
    for (int i = 0; i < 8; i++){
        s.push_back('1');
    }
    for (int i = 0; i < 8; i++){
        add_element(s);
        s[i] = '0';
    }
    compile_set();
    vector <int> frq(10);
    for (int i = 0; i < 256; i++){
        string s = "";
        for (int j = 0; j < 8; j++){
            s = char('0' + !!(i & (1 << j))) + s;
        }
        if(check_element(s)) {
            for (int j = 0; j < 8; j++){
                if (s[j] == '1') frq[j]++;
            }
        }
    }
    for (int i = 0; i < 8; i++){
        if (frq[i] != i + 1) {
            swap(p[i], p[frq[i] - 1]);
            break;
        }
    }
    // for (auto i: p){
    //     cout << i << " ";
    // }
    // cout << "\n";
    return p;
}

Compilation message (stderr)

paint.cpp:2:10: fatal error: messy.h: No such file or directory
    2 | #include "messy.h"
      |          ^~~~~~~~~
compilation terminated.