#include "robot.h"
#include "bits/stdc++.h"
using namespace std;
pair<int, char> bad = make_pair(-1, 'A');
vector<char> ord = {'W', 'S', 'E', 'N'};
pair<int, char> get(int now, int w, int s, int e, int n) {
if (s == -2 and e == -2) return make_pair(1, 'T');
vector<int> vec = {w, s, e, n};
if (count(vec.begin(), vec.end(), 1) > 1) return bad;
if (count(vec.begin(), vec.end(), 0) == 0) {
if (w != -2 or n != -2) return bad;
}
for (int i = 0; i < vec.size(); i++) {
if (vec[i] == 0) return make_pair(1, ord[i]);
}
for (int i = 0; i < vec.size(); i++) {
if (vec[i] == 1) return make_pair(2, ord[i]);
}
return bad;
}
void program_pulibot()
{
for (int now = 0; now <= 1; now++) {
for (int w = -2; w <= 2; w++) {
for (int s = -2; s <= 2; s++) {
for (int e = -2; e <= 2; e++) {
for (int n = -2; n <= 2; n++) {
auto it = get(now, w, s, e, n);
if (it.first == -1) continue;
set_instruction({now, w, s, e, n}, it.first, it.second);
}
}
}
}
}
}
# | 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... |