이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "robot.h"
using namespace std;
typedef long long ll;
// Cur, W, S, E, N
unordered_set<ll> check;
void instruct(vector<int> s, int z, char a, bool exp) {
vector<int> nw;
vector<vector<int>> scenarios(1, vector<int>(5));
for (int i = 0; i < 5; i++) {
scenarios[0][i] = s[i] == -9 ? -2 : s[i];
}
for (int i = 0; i < 5; i++) {
ll sz = scenarios.size();
if (s[i] == -1 && !exp) {
for (int j = 0; j < sz; j++) {
nw = scenarios[j];
nw[i] = -2;
scenarios.push_back(nw);
nw[i] = 2;
scenarios.push_back(nw);
}
}
if (s[i] == -9) {
for (int j = 0; j < sz; j++) {
nw = scenarios[j];
nw[i] = -1;
scenarios.push_back(nw);
nw[i] = 0;
scenarios.push_back(nw);
nw[i] = 1;
scenarios.push_back(nw);
nw[i] = 2;
scenarios.push_back(nw);
}
}
}
for (auto &e : scenarios) {
ll id = ((e[0] & 15) << (4 * 4)) | ((e[1] & 15) << (4 * 3)) | ((e[2] & 15) << (4 * 2)) | ((e[3] & 15) << (4 * 1)) | ((e[4] & 15) << (4 * 0));
if (check.count(id)) continue;
check.insert(id);
set_instruction(e, z, a);
}
}
// Cur, W, S, E, N
void program_pulibot() {
instruct({-9, -9, -2, -2, -9}, 1, 'T', false);
instruct({-9, -9, -9, 0, -9}, 1, 'E', false);
instruct({-9, -9, 0, -9, -9}, 1, 'S', false);
instruct({-9, 0, -9, -9, -9}, 1, 'W', false);
instruct({-9, -9, -9, -9, 0}, 1, 'N', false);
instruct({-9, 1, -1, -1, -1}, 2, 'W', false);
instruct({-9, -1, -1, -1, 1}, 2, 'N', false);
instruct({-9, -1, -1, 1, -1}, 2, 'E', false);
instruct({-9, -1, 1, -1, -1}, 2, 'S', false);
}
# | 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... |