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;
#define vi vector<int>
set<vi> st;
void add(int a,int b,int c,int d,int e,int f,char t){
vi v = {a,b,c,d,e};
if(st.find(v) != st.end())return;
st.insert(v);
cerr<<"ADD: "<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e<<' '<<f<<' '<<t<<endl;
set_instruction(vi({a,b,c,d,e}),f,t);
}
void add(vi v,int f,char t){
add(v[0],v[1],v[2],v[3],v[4],f,t);
}
const int C = 6;
void program_pulibot(){
for(int i = -2;i<=C;i++){
for(int j = -2;j<=C;j++){
add(0,i,-2,-2,j,1,'H');
add(0,i,-2,-2,2,1,'N');
add(0,2,-2,-2,i,1,'W');
if(i == 1||j == 1)for(int k = 2;k<=C;k++)add(k,-2,i,j,-2,1,'T');
}
}
for(int i = -2;i<=C;i++){
for(int j = -2;j<=C;j++){
for(int k = -2;k<=C;k++){
for(int l = -2;l<=C;l++){
bool one = (i == 1||j == 1||k == 1||l == 1);
if(i>1)add(1,i,j,k,l,1,'W');
else if(j>1)add(1,i,j,k,l,1,'S');
else if(k>1)add(1,i,j,k,l,1,'E');
else if(l>1)add(1,i,j,k,l,1,'N');
if(one){
for(int now = 0;now<=C;now++){
if(i>1)add(now,i,j,k,l,1,'W');
else if(j>1)add(now,i,j,k,l,1,'S');
else if(k>1)add(now,i,j,k,l,1,'E');
else if(l>1)add(now,i,j,k,l,1,'N');
}
}
add(0,i,j,k,l,2,'H');
for(int now = 2;now<=C;now++){
if(now == 2){
if(!i)add(now,i,j,k,l,now+1,'W');
else add(now,i,j,k,l,now+1,'H');
}
else if(now == 3){
if(!j)add(now,i,j,k,l,now+1,'S');
else add(now,i,j,k,l,now+1,'H');
}
else if(now == 4){
if(!k)add(now,i,j,k,l,now+1,'E');
else add(now,i,j,k,l,now+1,'H');
}
else if(now == 5){
if(!l)add(now,i,j,k,l,now+1,'N');
else add(now,i,j,k,l,now+1,'H');
}
else if(now == 6){
if(i>1)add(now,i,j,k,l,0,'W');
else if(j>1)add(now,i,j,k,l,0,'S');
else if(k>1)add(now,i,j,k,l,0,'E');
else if(l>1)add(now,i,j,k,l,0,'N');
}
}
}
}
}
}
return;
}
# | 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... |