이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |