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 <bits/stdc++.h>
#include "robot.h"
using namespace std;
#define pb push_back
#define st first
#define nd second
typedef long long ll;
typedef long double ld;
const ll I = 1000'000'000'000'000'000LL;
const int II = 2'000'000'000;
const ll M = 1000'000'007LL;
const int N = 1000'007;
int tab[N];
void Set(int a, int i, int j, int k, int l)
{
if(a == 0 && i == -2 && l == -2)
{
set_instruction({a, i, j, k, l}, 2, 'H');
return;
}
if(a == 0 && (j == -2 && k == -2))
{
if(i == 8)
set_instruction({a, i, j, k, l}, 1, 'W');
else
set_instruction({a, i, j, k, l}, 1, 'N');
return;
}
if(i == 1 || j == 1 || k == 1 || l == 1)
{
if(i == -2 && l == -2)
{
set_instruction({a, i, j, k, l}, 1, 'T');
return;
}
if(i == 8)
{
set_instruction({a, i, j, k, l}, 1, 'W');
return;
}
if(j == 9)
{
set_instruction({a, i, j, k, l}, 1, 'S');
return;
}
if(k == 6)
{
set_instruction({a, i, j, k, l}, 1, 'E');
return;
}
if(l == 7)
{
set_instruction({a, i, j, k, l}, 1, 'N');
return;
}
}
if(a == 0)
{
if(i == 8)
{
set_instruction({a, i, j, k, l}, 2, 'W');
return;
}
if(j == 9)
{
set_instruction({a, i, j, k, l}, 3, 'S');
return;
}
if(k == 8)
{
set_instruction({a, i, j, k, l}, 4, 'E');
return;
}
if(l == 7)
{
set_instruction({a, i, j, k, l}, 5, 'N');
return;
}
}
if(a > 1)
{
if(a < 6 && (i == 4 || i == 0))
{
set_instruction({a, i, j, k, l}, 6, 'W');
return;
}
if(a < 7 && (j == 5 || j == 0))
{
set_instruction({a, i, j, k, l}, 7, 'S');
return;
}
if(a < 8 && (k == 2 || k == 0))
{
set_instruction({a, i, j, k, l}, 8, 'E');
return;
}
if(a < 9 && (l == 3 || l == 0))
{
set_instruction({a, i, j, k, l}, 9, 'N');
return;
}
set_instruction({a, i, j, k, l}, 0, 'H');
return;
}
}
void program_pulibot()
{
for(int a = 0; a <= 9; ++a)
for(int i = -2; i <= 9; ++i)
for(int j = -2; j <= 9; ++j)
for(int k = -2; k <= 9; ++k)
for(int l = -2; l <= 9; ++l)
Set(a, i, j, k, l);
}
# | 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... |