이 제출은 이전 버전의 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 <= 5; s++){
for (int e = -2; e <= 5; e++){
for (int n = -2; n <= 5; n++){
for (int w = -2; w <= 5; w++){
if ((n==-2 && s==-2) || (w==-2 && e==-2)) continue;
//eger bulundugum cell 4 ise ayri bi tarife uygulicam
if (e==4){
a({4,w,s,e,n},5,'E');
a({5,w,s,e,n},5,'E');
}
else if (s==4){
a({4,w,s,e,n},5,'S');
a({5,w,s,e,n},5,'S');
}
else {
if (n==5){
a({4,w,s,e,n},0,'N');
a({5,w,s,e,n},0,'N');
}
else if (w==5){
a({4,w,s,e,n},0,'W');
a({5,w,s,e,n},0,'W');
}
else if (n<4 && n>=1){
a({4,w,s,e,n},0,'N');
a({5,w,s,e,n},0,'N');
}
else {
a({4,w,s,e,n},0,'W');
a({5,w,s,e,n},0,'W');
}
}
if (e==1 || s==1){
if (e==4 || s==4){
//ilk temizle
if (e==4){
a({2,w,s,e,n},2,'E');
a({3,w,s,e,n},2,'E');
}
else {
a({2,w,s,e,n},2,'S');
a({3,w,s,e,n},2,'S');
}
}
else if (w<=0 && n<=0){
a({2,w,s,e,n},1,'T');
a({3,w,s,e,n},1,'T');
}
else if (w>0){
a({2,w,s,e,n},1,'W');
a({3,w,s,e,n},1,'W');
}
else {
a({2,w,s,e,n},1,'N');
a({3,w,s,e,n},1,'N');
}
continue;
}
//current cell 0
if (s==-2 && e==-2){
if (n<=0){
a({0,w,s,e,n},1,'W');
}
else {
a({0,w,s,e,n},1,'N');
}
}
else {
//asagi dallanmaya calis
if (s!=0){
a({0,w,s,e,n},2,'H');
}
else {
a({0,w,s,e,n},2,'S');
}
}
//current cell 2
//saga dallanmaya calis
if (e!=0){
a({2,w,s,e,n},3,'H');
}
else {
a({2,w,s,e,n},3,'E');
}
//3 (gg)
int ele = 4;
if (e==1 || s==1){
ele = 1;
}
if (w>0){
a({3,w,s,e,n},4,'W');
}
else if (n>0){
a({3,w,s,e,n},4,'N');
}
else {
a({3,w,s,e,n},4,'T');
}
}
}
}
}
}
컴파일 시 표준 에러 (stderr) 메시지
robot.cpp: In function 'void program_pulibot()':
robot.cpp:93:9: warning: variable 'ele' set but not used [-Wunused-but-set-variable]
93 | int ele = 4;
| ^~~
# | 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... |