이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "robot.h"
#ifdef ngu
#include "grader.cpp"
#endif // ngu
#include<bits/stdc++.h>
using namespace std;
void program_pulibot()
{
for(int cur = 0; cur <= 2; cur++) for(int west = -2; west <= 2; west++) {
for(int south = -2; south <= 2; south++) for(int east = -2; east <= 2; east++) for(int north = -2; north <= 2; north++) {
vector<int> state = {cur, west, south, east, north};
if (east == -2 && south == -2 && cur == 0) {
if (north == 1) set_instruction(state, 1, 'N');
else if (west == 1) set_instruction(state, 1, 'W');
continue;
}
if (north == -2 && west == -2 && south != 2 && east != 2 && cur == 1) {
set_instruction(state, 1, 'T');
continue;
}
if (cur == 0 || (cur == 1 && south != 1 && east != 1)) {
if (east == 0) {
set_instruction(state, 1, 'E');
}
else if (south == 0) {
set_instruction(state, 1, 'S');
}
else {
if (north == 1) set_instruction(state, 2, 'N');
else set_instruction(state, 2, 'W');
}
}
else if (cur == 1) {
if (east == 2) {
set_instruction(state, 1, 'E');
}
else if (south == 2) {
set_instruction(state, 1, 'S');
}
else if (north == 1) {
set_instruction(state, 1, 'N');
}
else if (west == 1) {
set_instruction(state, 1, 'W');
}
}
else if (cur == 2) {
if (east == 2) set_instruction(state, 2, 'E');
else if (south == 2) set_instruction(state, 2, 'S');
else {
if (west == 2) set_instruction(state, 0, 'W');
else if (north == 2) set_instruction(state, 0, 'N');
else if (west == 1) set_instruction(state, 0, 'W');
else if (north == 2) set_instruction(state, 0, 'N');
}
}
}
}
}
# | 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... |