이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "robot.h"
#include <bits/stdc++.h>
using namespace std;
enum directions {
e,
s,
n,
w,
};
void program_pulibot() {
for(int current=0;current<=5;current++) {
for(int west=-2;west<=5;west++) {
for(int south=-2;south<=5;south++) {
for(int north=-2;north<=5;north++) {
for(int east=-2;east<=5;east++) {
vector<int> cur = {current,west,south,east,north};
directions parent = w;
if(west==2)parent=w;
else if(north==3)parent=n;
if(current==1) {
if(north==-2 and west==-2) {
set_instruction(cur,1,'T');
continue;
}
char par;
if(parent==w)par='W';
else par='N';
set_instruction(cur,1,par);
continue;
}
if(south==-2 and east==-2) {
// we have found a path
set_instruction(cur,1,'H');
continue;
}
if(current==0) {
// Go east, no processing needed
if(east!=0){
set_instruction(cur,2,'H');
} else {
set_instruction(cur,2,'E');
}
} else if(current==2) {
// Process that we came from east and try to go south
if(east==1) {
set_instruction(cur,1,'H');
} else if(south!=0) {
set_instruction(cur,3,'H');
} else {
set_instruction(cur,3,'S');
}
} else if(current==3) {
// Process that we came from south and try to go back
if(south==1) {
set_instruction(cur,1,'H');
} else {
char par;
if(parent==w)par='W';
else par='N';
set_instruction(cur,0,par);
}
}
}
}
}
}
}
}
# | 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... |