이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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>v1[8],v2[8];
v1[down+2].push_back('S');
v2[left+2].push_back('W');
v1[right+2].push_back('E');
v2[top+2].push_back('N');
if(v2[3].size()){
if(v1[6].empty())
ACT='T';
else ACT=v1[6][0];
COL=1;
}else if(v1[6].empty()&&v2[6].empty()&&v2[5].empty()&&cur-4) {
if(v1[2].empty()&&v2[7].empty())
return COL=0,void(ACT='H');
if(v1[2].empty())
return COL=2,void(ACT=v2[7][0]);
COL=5;
return void(ACT=v1[2][0]);
} else if(v2[5].size()) {
if(v1[4].size())
return COL=3,void(ACT=v1[4][0]);
else return COL=0,void(ACT=v2[5][0]);
} else {
int B=0;
if(v1[6].size()==1&&v2[7].size()==1)
B=1;
if(cur==4)
B=1;
if(top==-2&&left==-2)
B=1;
if(v1[4].size())
return COL=B+3,void(ACT=v1[4][0]);
else if(v2[7].size())
return COL=B+3,void(ACT=v2[7][0]);
else if(top==-2&&left==-2) {
COL=1;
if(v1[6].empty())
return void(ACT='T');
return COL=1,void(ACT=v1[6][0]);
} else if(v2[6].size())
return COL=0,void(ACT=v2[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... |