제출 #87891

#제출 시각아이디문제언어결과실행 시간메모리
87891Retro3014Unscrambling a Messy Bug (IOI16_messy)C++17
컴파일 에러
0 ms0 KiB
#include "paint.h"

#include <string>
#include <vector>

using namespace std;

#define MAX_N 200000
#define MAX_K 100

bool vst[MAX_N+10][MAX_K+10], vst2[MAX_N+10][MAX_K+10];
bool DP[MAX_N+10][MAX_K+10], DP2[MAX_N+10][MAX_K+10];
bool chk1[MAX_N+10], chk2[MAX_N+10];
int N, K;
string str, ans;
vector<int> v;

bool put(int x, int y){
    if(vst2[x][y])  return DP2[x][y];
    vst2[x][y]=true;
    if(x+v[y]>N){
        DP2[x][y]=false;
        return false;
    }
    for(int i=x; i<x+v[y]; i++){
        if(str[i]=='_'){
            DP2[x][y]=false;
            return false;
        }
    }
    if(x+v[y]==N || str[x+v[y]]!='X')   DP2[x][y]=true;
    return DP2[x][y];
}

bool check(int x, int y){
    if(vst[x][y]){
        return DP[x][y];
    }
    vst[x][y]=true;
    bool b=false;
    if(x>=N){
        if(y==K)    b=true;
        DP[x][y]=b;
        return b;
    }
    if(str[x]!='X' && (vst[x+1][y]?DP[x+1][y]:check(x+1, y))){
        chk2[x]=true;
        b=true;
    }
    if(y<K && (vst2[x][y]?DP2[x][y]:put(x, y)) && (vst[x+v[y]+1][y+1]?DP[x+v[y]+1][y+1]:check(x+v[y]+1, y+1))){
        for(int i=x; i<x+v[y]; i++){
            chk1[i]=true;
        }
        chk2[x+v[y]]=true;
        b=true;
    }
    DP[x][y]=b;
    return b;
}

string solve_puzzle(string s, vector<int> c) {
    N=(int)s.size(); K=(int)c.size();
    for(int i=0; i<s.size(); i++){
        str.push_back(s[i]);
    }
    for(int i=0; i<c.size(); i++){
        v.push_back(c[i]);
    }
    check(0, 0);
    for(int i=0; i<N; i++){
        if(chk1[i]){
            if(chk2[i]){
                ans.push_back('?');
            }
            else{
                ans.push_back('X');
            }
        }
        else if(chk2[i]){
            ans.push_back('_');
        }
    }
    return ans;
}

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

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