제출 #1064752

#제출 시각아이디문제언어결과실행 시간메모리
1064752deera로봇 대회 (IOI23_robot)C++17
10 / 100
131 ms5888 KiB
#include <bits/stdc++.h>
#include "robot.h"
using namespace std;

const int B = -2;
const int O = -1;

void program_pulibot()
{
    // set_instruction({0,B,0,0,B},1,'E');
    // set_instruction({0,1,0,0,B},1,'E');
    // set_instruction({0,0,0,B,1},1,'S');
    // set_instruction({0,1,0,B,B},1,'S');
    // set_instruction({0,0,B,B,1},1,'T');

    // set_instruction({0,1,0,O,B},1,'S');
    // set_instruction({0,1,B,O,0},1,'N');

    // set_instruction({0,B,0,O,B},1,'S');
    // set_instruction({0,B,B,O,0},1,'N');

    const int S[4] = {B, O, 0, 1};

    for (int c: S) for (int w: S) for (int s: S) for (int e: S) for (int n: S)
    {
        // you can't be on an obstacle or a border
        if (c == B || c == O) continue;

        // no backtracking for now
        if (c == 1 || e == 1) continue;

        // if you are in the bottom right corner, you are done
        if (e == B && s == B) {
            set_instruction({c, w, s, e, n}, 1, 'T');
            continue;
        }

        // if you can go straight ahead do it
        if (e == 0) {
            set_instruction({c, w, s, e, n}, 1, 'E');
            continue;
        }

        if (n < 0 && e < 0) {
            set_instruction({c, w, s, e, n}, 1, 'S');
            continue;
        }

        if (s < 0 && e < 0) {
            set_instruction({c, w, s, e, n}, 1, 'N');
            continue;
        }
    }
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...