이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "robot.h"
#include <vector>
void a(std::vector<int> x,int t,char y){set_instruction(x,t,y);}
void program_pulibot(){
for (int s = -2; s <= 4; s++){
for (int e = -2; e <= 4; e++){
for (int n = -2; n <= 4; n++){
for (int w = -2; w <= 4; w++){
if (s==1 || e==1 || n==1 || w==1){
if (s>1){
for (int x = 0; x <= 4; x++){
a({x,w,s,e,n},1,'S');
}
}
else if (e>1){
for (int x = 0; x <= 4; x++){
a({x,w,s,e,n},1,'E');
}
}
else if (n>1){
for (int x = 0; x <= 4; x++){
a({x,w,s,e,n},1,'N');
}
}
else if (w>1){
for (int x = 0; x <= 4; x++){
a({x,w,s,e,n},1,'W');
}
}
else {
for (int x = 0; x <= 4; x++){
a({x,w,s,e,n},1,'T');
}
}
continue;
}
if (e==-2 && s==-2){
if (n>0){
a({0,w,s,e,n},1,'N');
}
else {
a({0,w,s,e,n},1,'W');
}
continue;
}
else if (e<0 && s<0){
if (n>0){
a({0,w,s,e,n},0,'N');
}
else {
a({0,w,s,e,n},0,'W');
}
continue;
}
if (e!=0){
a({0,w,s,e,n},2,'H');
}
else {
a({0,w,s,e,n},2,'E');
}
if (n!=0){
a({2,w,s,e,n},3,'H');
}
else {
a({2,w,s,e,n},3,'N');
}
if (s!=0){
a({3,w,s,e,n},4,'H');
}
else {
a({3,w,s,e,n},4,'S');
}
if (w!=0){
a({4,w,s,e,n},5,'H');
}
else {
a({4,w,s,e,n},5,'W');
}
if (w>0){
a({5,w,s,e,n},0,'W');
}
else if (n>0){
a({5,w,s,e,n},0,'N');
}
else if (s>0){
a({5,w,s,e,n},0,'S');
}
else {
a({5,w,s,e,n},0,'E');
}
}
}
}
}
}
# | 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... |