This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
// hola soy Dember :D
// 31/03/2024
#include <bits/stdc++.h>
#include "robot.h"
#define ll long long
#define pll pair<ll,ll>
#define F first
#define S second
#define Z size()
#define pb push_back
#define bp pop_back
#define fo(x,y,z) for(ll x=y; x<=z; x++)
#define of(x,y,z) for(ll x=y; x>=z; x--)
#define all(n) n.begin(), n.end()
#define arr(x,y,z) x+y, x+y+z
using namespace std;
void program_pulibot()
{
// H W S E N
fo(H,-2,4){
fo(W,-2,4){
fo(S,-2,4){
fo(E,-2,4){
fo(N,-2,4){
ll xd=2;
char dir='E';
if(S==-2&&E==-2){
xd=1;
if(H==1){
if(E==2) dir='E';
else if(N==2) dir='N';
else if(S==2) dir='S';
else if(W==2) dir='W';
else dir='H';
}
else dir='H';
//PQ? :(
}
else if(E==1||N==1||S==1||W==1){
xd=1;
if(E==3||N==3||S==3||W==3) {
xd=4;
if(E==3) dir='E';
else if(N==3) dir='N';
else if(S==3) dir='S';
else if(W==3) dir='W';
}
else if(N==-2&&W==-2) dir='T';
else if(E==2) dir='E';
else if(N==2) dir='N';
else if(S==2) dir='S';
else if(W==2) dir='W';
//Ya me estoy arrepintiendo de hacer esto ;'(
}
else if(E==4||N==4||S==4||W==4){
xd=0;
if(E==3||N==3||S==3||W==3) {
xd=4;
if(E==3) dir='E';
else if(N==3) dir='N';
else if(S==3) dir='S';
else if(W==3) dir='W';
}else if(H=='3'){
xd=0;
if(E==4) dir='E';
else if(N==4) dir='N';
else if(S==4) dir='S';
else if(W==4) dir='W';
}
else if(E==4) dir='E';
else if(N==4) dir='N';
else if(S==4) dir='S';
else if(W==4) dir='W';
//llevo casi media hora programando esto ._.
}
else if(E==0) dir='E';
else if(N==0) dir='N';
else if(S==0) dir='S';
else if(W==0) dir='W';
else{
xd=3;
if(E==2) dir='E';
else if(N==2) dir='N';
else if(S==2) dir='S';
else if(W==2) dir='W';
}
//LISTOOOO :D
vector<int> s(5);
s[0]=H;
s[1]=W;
s[2]=S;
s[3]=E;
s[4]=N;
set_instruction(s, xd, dir);
//Se buguio >(
//Ya jaloooo >DDDDDDDD
}
}
}
}
}
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... |