# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1071117 | Faisal_Saqib | Robot Contest (IOI23_robot) | C++17 | 0 ms | 0 KiB |
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"
int op=10000;
void choose(int len,vector<int> pos,vector<int> taken)
{
if(len==0)
{
if(taken[0]<0)return;
int mx=100;
char tp='?';
string dir="FWSEN";;
for(int i=1;i<taken.size();i++)
{
if(taken[i]>=0 and taken[i]<mx)
{
mx=taken[i];
tp=dir[i];
}
}
if(taken[2]==-2 and taken[3]==-2)
{
set_instruction(taken,1,'T');
}
else
{
if(tp!='?')
{
if((taken[0]+1)<=19)
set_instruction(taken,taken[0]+1,tp);
}
}
return;
}
for(auto i:pos)
{
taken.push_back(i);
choose(len-1,pos,taken);
taken.pop_back();
}
}
void program_pulibot()
{
vector<int> states = {-1,-2};
for(int i=0;i<=19;i++)
states.push_back(i);
choose(5,states,{});
// set_instruction({0, -2, -1, 0, -2}, 1, 'E');
// set_instruction({0, 1, -1, 0, -2}, 1, 'E');
// set_instruction({0, 1, 0, -2, -2}, 1, 'S');
// set_instruction({0, -1, -2, -2, 1}, 1, 'T');
}