#include "robot.h"
#include <bits/stdc++.h>
using namespace std;
void program_pulibot()
{
const char goleft = 'E', goright = 'W', godown = 'S', goup = 'N', term = 'T';
// . < v > ^
vector<int> states = {-2, -1, 0, 1, 2}, states_blocked = {-2, -1, 1, 2};
set<vector<int>> st;
for (auto i : states) {
for (auto j : states) {
for (auto k : states) {
vector<int> v = {0, i, -2, -2, j};
if (st.count(v)) continue;
st.insert(v);
set_instruction(v, 1, term);
}
}
}
for (auto i : states) {
for (auto j : states) {
for (auto k : states) {
vector<int> v = {0, i, j, 0, k};
if (st.count(v)) continue;
st.insert(v);
set_instruction(v, 1, goleft);
}
}
}
for (auto i : states) {
for (auto j : states) {
for (auto k : states) {
vector<int> v = {1, i, j, 0, k};
if (st.count(v)) continue;
st.insert(v);
set_instruction(v, 1, goleft);
}
}
}
for (auto i : states_blocked) {
for (auto j : states_blocked) {
for (auto k : states_blocked) {
vector<int> v = {0, i, j, 1, k};
if (st.count(v)) continue;
st.insert(v);
set_instruction(v, 2, goleft);
}
}
}
for (auto i : states_blocked) {
for (auto j : states_blocked) {
for (auto k : states_blocked) {
vector<int> v = {1, i, j, 1, k};
if (st.count(v)) continue;
st.insert(v);
set_instruction(v, 2, goleft);
}
}
}
for (auto i : states) {
for (auto j : states) {
for (auto k : states) {
vector<int> v = {0, i, 0, j, k};
if (st.count(v)) continue;
st.insert(v);
set_instruction(v, 1, godown);
}
}
}
for (auto i : states) {
for (auto j : states) {
for (auto k : states) {
vector<int> v = {1, i, 0, j, k};
if (st.count(v)) continue;
st.insert(v);
set_instruction(v, 1, godown);
}
}
}
for (auto i : states_blocked) {
for (auto j : states_blocked) {
for (auto k : states_blocked) {
vector<int> v = {0, i, 1, j, k};
if (st.count(v)) continue;
st.insert(v);
set_instruction(v, 2, godown);
}
}
}
for (auto i : states_blocked) {
for (auto j : states_blocked) {
for (auto k : states_blocked) {
vector<int> v = {1, i, 1, j, k};
if (st.count(v)) continue;
st.insert(v);
set_instruction(v, 2, godown);
}
}
}
//
for (auto i : states_blocked) {
for (auto j : states_blocked) {
for (auto k : states_blocked) {
vector<int> v = {0, i, j, k, 1};
if (st.count(v)) continue;
st.insert(v);
set_instruction(v, 2, goup);
}
}
}
for (auto i : states_blocked) {
for (auto j : states_blocked) {
for (auto k : states_blocked) {
vector<int> v = {0, i, j, k, 0};
if (!st.count(v)) {
st.insert(v);
set_instruction(v, 1, goup);
}
}
}
}
for (auto i : states_blocked) {
for (auto j : states_blocked) {
for (auto k : states_blocked) {
vector<int> v = {1, i, j, k, 0};
if (!st.count(v)) {
st.insert(v);
set_instruction(v, 1, goup);
}
}
}
}
for (auto i : states_blocked) {
for (auto j : states_blocked) {
for (auto k : states_blocked) {
vector<int> v = {1, i, j, k, 1};
if (!st.count(v)) {
st.insert(v);
set_instruction(v, 2, goup);
}
}
}
}
//
for (auto i : states_blocked) {
for (auto j : states_blocked) {
for (auto k : states_blocked) {
vector<int> v = {0, 1, i, j, k};
if (!st.count(v)) {
st.insert(v);
set_instruction(v, 2, goright);
}
}
}
}
for (auto i : states_blocked) {
for (auto j : states_blocked) {
for (auto k : states_blocked) {
vector<int> v = {1, 1, i, j, k};
if (!st.count(v)) {
st.insert(v);
set_instruction(v, 2, goright);
}
}
}
}
for (auto i : states_blocked) {
for (auto j : states_blocked) {
for (auto k : states_blocked) {
vector<int> v = {0, 0, i, j, k};
if (!st.count(v)) {
st.insert(v);
set_instruction(v, 1, goright);
}
}
}
}
for (auto i : states_blocked) {
for (auto j : states_blocked) {
for (auto k : states_blocked) {
vector<int> v = {1, 0, i, j, k};
if (!st.count(v)) {
st.insert(v);
set_instruction(v, 1, goright);
}
}
}
}
for (auto i : states_blocked) {
for (auto j : states_blocked) {
vector<int> v = {1, 0, i, j, 0};
if (!st.count(v)) {
st.insert(v);
set_instruction(v, 1, goright);
}
v = {0, 0, i, j, 0};
if (!st.count(v)) {
st.insert(v);
set_instruction(v, 1, goright);
}
}
}
}
# | 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... |