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"
#include <bits/stdc++.h>
using namespace std;
void program_pulibot() {
auto Add = [&](int my, int up, int down, int left, int right, int val, char dir) {
set_instruction({my, left, down, right, up}, val, dir);
};
for (int up = -2; up <= 4; up++) {
for (int down = -2; down <= 4; down++) {
for (int left = -2; left <= 4; left++) {
for (int right = -2; right <= 4; right++) {
for (int my = 0; my <= 4; my++) {
int cnt = 0;
if (down > 0) {
cnt += 1;
}
if (right > 0) {
cnt += 1;
}
if (cnt == 2) {
continue;
}
if (down == -2 && right == -2) {
if (up > 0) {
Add(my, up, down, left, right, 1, 'N');
} else if (left > 0) {
Add(my, up, down, left, right, 1, 'W');
}
continue;
}
if (cnt == 0) {
if (my == 0) {
if (right == 0) {
Add(my, up, down, left, right, 1, 'E');
} else {
Add(my, up, down, left, right, 1, 'H');
}
} else if (my == 1) {
if (down == 0) {
Add(my, up, down, left, right, 2, 'S');
} else {
Add(my, up, down, left, right, 2, 'H');
}
} else {
if (up > 0) {
Add(my, up, down, left, right, 0, 'N');
} else if (left > 0) {
Add(my, up, down, left, right, 0, 'W');
}
}
} else {
if (up == -2 && left == -2) {
Add(my, up, down, left, right, 1, 'T');
} else {
if (up > 0) {
Add(my, up, down, left, right, 1, 'N');
} else {
if (left > 0) {
Add(my, up, down, left, right, 1, 'W');
}
}
}
}
}
}
}
}
}
}
# | 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... |