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"
void program_pulibot()
{
//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');
for(int i = -2; i <= 1; i++)
for(int j = -2; j <= 1; j++)
for(int k = -2; k <= 1; k++)
set_instruction({0,i,j,0,k},1,'E'); // move to the right whenever possible
for(int i = -2; i <= 1; i++){
if(i) set_instruction({0,-2,0,i,-2},1,'S'), set_instruction({0,1,0,i,-2},1,'S'); // if cant move right, move down
if(i and i!=-2) set_instruction({0,-2,-2,i,0},1,'N'), set_instruction({0,1,-2,i,0},1,'N'); // if cant move right, move up, unless you are at last destination
}
for(int i = -2; i <= 1; i++)
for(int j = -2; j <= 1; j++)
set_instruction({0,i,-2,-2,j},1,'T');
}
/*
--------------------
-0x000000x00000xx00-
-0000xx0000x0000000-
--------------------
{0 b c 0 e},1,'E'
if i can possibly move to the right, always do it
{0 1 0 anybut0 -2},1,'S'
{0 1 -2 anybut0 0},1,'N'
if i can't but i'm in row 1, move down, if row 2 move up
if i'm at last row, but i'm at row 1, move down
else terminate
two cases:
case 1: I'm on 1st row
case 2: I'm on 2nd row
*/
# | 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... |