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;
int COL;
char ACT;
void program_bot(int top,int left,int right,int down,int cur){
if(left==-2&&right==-2)
return COL=0,void(ACT='H');
if(top==-2&&down==-2)
return COL=0,void(ACT='H');
if(right==down&&right==-2&&cur==0)
return COL=4,void(ACT='H');
vector<int>v[8];
v[down+2].push_back('S');
v[left+2].push_back('W');
v[right+2].push_back('E');
v[top+2].push_back('N');
if(v[3].size()){
if(v[6].empty())
ACT='T';
else ACT=v[6][0];
COL=1;
}else if(v[6].empty()&&v[5].empty()&&cur-4) {
if(v[2].empty()&&v[7].empty())
return COL=0,void(ACT='H');
if(v[2].empty())
return COL=2,void(ACT=v[7][0]);
COL=5;
return void(ACT=v[2][0]);
} else if(v[5].size()) {
if(v[4].size())
return COL=3,void(ACT=v[4][0]);
else return COL=0,void(ACT=v[5][0]);
} else {
int B=0;
if(v[6].size()==1&&v[7].size()==1)
B=1;
if(cur==4)
B=1;
if(top==-2&&left==-2)
B=1;
if(v[4].size())
return COL=B+3,void(ACT=v[4][0]);
else if(v[7].size())
return COL=B+3,void(ACT=v[7][0]);
else if(top==-2&&left==-2) {
COL=1;
if(v[6].empty())
return void(ACT='T');
return COL=1,void(ACT=v[6][0]);
} else if(v[6].size())
return COL=0,void(ACT=v[6][0]);
COL=1,ACT='H';
}
}
void program_pulibot(){
for(int top=-2;top<6;top++)
for(int left=-2;left<6;left++)
for(int right=-2;right<6;right++)
for(int bot=-2;bot<6;bot++)
for(int cur=0;cur<6;cur++)
program_bot(top,left,right,bot,cur),
set_instruction({cur,left,bot,right,top},COL,ACT);
}
# | 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... |