Submission #1295625

#TimeUsernameProblemLanguageResultExecution timeMemory
1295625goulthenUnscrambling a Messy Bug (IOI16_messy)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include "messy.h"
using namespace std;



vector<int> restore_permutation(int n, int w, int r) {
    vector<int> p(n);

    string pfx = "";
    rep(i,0,n-1) {
        pfx += '0';
        string cur = pfx;
        rep(j,i+1,n-1) cur+='1';
        add_element(cur);
        base.pb(cur);
    }
    compile_set();

    rep(i,0,n-1) {
        string base = "";
        rep(j,0,n-1) base+='0';

        rep(j,0,n-1) {
            if(base[j] == '1') continue;
            base[j] = '1';
            if(check_element(base)) {
                p[i] = j;
                break;
            }
            base[j] = '0';
        }
    }

    return p;
}

Compilation message (stderr)

messy.cpp: In function 'std::vector<int> restore_permutation(int, int, int)':
messy.cpp:11:9: error: 'i' was not declared in this scope
   11 |     rep(i,0,n-1) {
      |         ^
messy.cpp:11:5: error: 'rep' was not declared in this scope
   11 |     rep(i,0,n-1) {
      |     ^~~
messy.h:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
messy_c.h:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~