답안 #841549

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
841549 2023-09-01T16:28:08 Z QwertyPi 로봇 (APIO13_robots) C++14
컴파일 오류
0 ms 0 KB
#include "robot.h"
#include <bits/stdc++.h>

const int ALL = -3;
const int WALL = -2;
const int STONE = -1;
const int EMPTY = 0;
const int PATH = 1;
const int VISITED = 2;
const int LEFT = 3;
const int DOWN = 4;
const int RIGHT = 5;
const int UP = 6;
const int K_MAX = 6;

using namespace std;

const char DIR_STAY = 'H';
const char DIR_LEFT = 'W';
const char DIR_DOWN = 'S';
const char DIR_RIGHT = 'E';
const char DIR_UP = 'N';
const char DIR_TERM = 'T';

map<vector<int>, pair<int, char>> mp;

// {CELL, LEFT, DOWN, RIGHT, UP}
void instruct(vector<int> A, int colour, char action){
    for(int i0 = A[0] == ALL ? -2 : A[0]; i0 <= (A[0] == ALL ? K_MAX : A[0]); i0++){
        for(int i1 = A[1] == ALL ? -2 : A[1]; i1 <= (A[1] == ALL ? K_MAX : A[1]); i1++){
            for(int i2 = A[2] == ALL ? -2 : A[2]; i2 <= (A[2] == ALL ? K_MAX : A[2]); i2++){
                for(int i3 = A[3] == ALL ? -2 : A[3]; i3 <= (A[3] == ALL ? K_MAX : A[3]); i3++){
                    for(int i4 = A[4] == ALL ? -2 : A[4]; i4 <= (A[4] == ALL ? K_MAX : A[4]); i4++){
                        vector<int> a = {i0, i1, i2, i3, i4};
                        if(mp.count(a)) continue; mp[a] = {colour, action};
                        set_instruction(a, colour, action);
                    }
                }
            }
        }
    }
}

void program_pulibot(){
    instruct({ALL, ALL, ALL, EMPTY, ALL}, 1, DIR_RIGHT);
    instruct({ALL, ALL, EMPTY, ALL, ALL}, 1, DIR_DOWN);
    instruct({ALL, ALL, WALL, WALL, ALL}, 1, DIR_TERM);
}

Compilation message

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