제출 #1325654

#제출 시각아이디문제언어결과실행 시간메모리
1325654eri16Unscrambling a Messy Bug (IOI16_messy)C++20
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h>
#include "messy.h"

using namespace std;

vector<int> restore_permutation(int n, int w, int r){
    
    string s;
    bool mull;
    
    for (int i=0; i<n; i++){s.push_back('0');}
    
    for(int i=0; i<n; i++){
        s[i]='1';
        add_element(s);
    }
    
    compile_set();
    
    vector <int> ans(n);
    
    for(int i=0; i<n; i++){
        s[i]='0';
    }
    
    for (int i=0; i<n; i++){
        for (int j=0; j<n; j++){
            if (s[j]=='0'){
                s[j]='1';
                mull=check_element(s);
                if (mull){
                    ungepruft[j]=0;
                    ans[j]=i;
                    break;
                }
                else{
                    s[j]='0';
                }
            }        
        }
    }
    return ans;
}

컴파일 시 표준 에러 (stderr) 메시지

messy.cpp: In function 'std::vector<int> restore_permutation(int, int, int)':
messy.cpp:32:21: error: 'ungepruft' was not declared in this scope
   32 |                     ungepruft[j]=0;
      |                     ^~~~~~~~~
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
      |         ^~~~