This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "robot.h"
#include<bits/stdc++.h>
using namespace std;
const int Z=4;
void program_pulibot()
{
for(int a=-2;a<=Z;a++) for(int b=-2;b<=Z;b++) for(int c=-2;c<=Z;c++) for(int d=-2;d<=Z;d++){
char s;
if(b==-2 && c==-2) s='H';
else{
if(a==0) s='W';
else if(b==0) s='S';
else if(c==0) s='E';
else if(d==0) s='N';
else s='H';
}
set_instruction({0,a,b,c,d},2,s);
}
for(int a=-2;a<=Z;a++) for(int b=-2;b<=Z;b++) for(int c=-2;c<=Z;c++) for(int d=-2;d<=Z;d++){
if((b==-2 && c==-2) || a==1 || b==1 || c==1 || d==1){
set_instruction({2,a,b,c,d},3,'H');
continue;
}
int x=2;char s='H';
if(a==0) s='W';
else if(b==0) s='S';
else if(c==0) s='E';
else if(d==0) s='N';
else{
x=3;
if(a==2) s='W';
else if(b==2) s='S';
else if(c==2) s='E';
else if(d==2) s='N';
}
set_instruction({2,a,b,c,d},x,s);
}
for(int a=-2;a<=Z;a++) for(int b=-2;b<=Z;b++) for(int c=-2;c<=Z;c++) for(int d=-2;d<=Z;d++){
int x=4;char s='H';
if(a==3) s='W';
else if(b==3) s='S';
else if(c==3) s='E';
else if(d==3) s='N';
else{
x=0;
if(a==4) s='W';
else if(b==4) s='S';
else if(c==4) s='E';
else if(d==4) s='N';
else{
x=1;
if(a==2) s='W';
else if(b==2) s='S';
else if(c==2) s='E';
else if(d==2) s='N';
else s='T';
}
}
set_instruction({3,a,b,c,d},x,s);
}
for(int a=-2;a<=Z;a++) for(int b=-2;b<=Z;b++) for(int c=-2;c<=Z;c++) for(int d=-2;d<=Z;d++){
int x=4;char s='H';
if(a==3) s='W';
else if(b==3) s='S';
else if(c==3) s='E';
else if(d==3) s='N';
else{
x=0;
if(a==4) s='W';
else if(b==4) s='S';
else if(c==4) s='E';
else if(d==4) s='N';
else{
x=1;
if(a==2) s='W';
else if(b==2) s='S';
else if(c==2) s='E';
else if(d==2) s='N';
else s='T';
}
}
set_instruction({4,a,b,c,d},x,s);
}
}
/*
4 4
0 0 0 0
1 1 1 0
0 0 0 0
0 1 1 0
*/
# | 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... |