#include "robot.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define loop(n, i) for (int i = 0; i < n; i++)
#define ALL(x) begin(x), end(x)
#define sz(x) (int)x.size()
typedef set<int> si;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef set<ii> sii;
typedef vector<ii> vii;
int max_col = 4;
void program_pulibot()
{
for (int c = 0; c <= max_col; c++)
{
for (int w = -2; w <= max_col; w++)
{
for (int s = -2; s <= max_col; s++)
{
for (int e = -2; e <= max_col; e++)
{
for (int n = -2; n <= max_col; n++)
{
auto seti = [&](int leave, char dir)
{
set_instruction({c, w, s, e, n}, leave, dir);
};
auto goToB = [&](int i, int leave)
{
if (n == i)
seti(leave, 'N');
else if (w == i)
seti(leave, 'W');
};
auto goToF = [&](int i, int leave)
{
if (s == i)
seti(leave, 'S');
else if (e == i)
seti(leave, 'E');
};
si burenB = {w, n};
si burenF = {s, e};
if (burenF.count(1) || burenB.count(1) || burenB.count(4))
{
if (burenF.count(2))
goToF(2, c == 2 || c == 4 ? 4 : 1);
else if (burenB.count(4))
goToB(4, 0);
else if (burenB.count(3))
goToB(3, 1);
else if (c == 4)
goToB(1, 0);
else if (c == 2)
goToB(1, 0);
else
seti(1, 'T');
}
else
{
if (s == -2 && e == -2)
goToB(3, 1);
else if (burenF.count(0))
goToF(0, 3);
else
{
goToB(3, 2);
}
}
}
}
}
}
}
}
# | 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... |