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;
#define arr array
#define si set_instruction
pair<char, int> get_action(arr<int, 5> state) {
if(state[3] == -2) {
if(state[4] == -2) return {'S', 1};
return {'T', 1};
}
if(state[3] == 0) return {'E', 1};
if(state[2] == -2) return {'N', 1};
return {'S', 1};
}
void all_state(arr<int, 5> cur, int i) {
if(i==5) {
auto action = get_action(cur);
set_instruction({cur[0], cur[1], cur[2], cur[3], cur[4]}, action.second, action.first);
return;
}
cur[i] = -2;
all_state(cur, i+1);
cur[i] = -1;
all_state(cur, i+1);
cur[i] = 0;
all_state(cur, i+1);
cur[i] = 1;
all_state(cur, i+1);
}
// self, west, south, east, north
void program_pulibot()
{
all_state({0, 0, 0, 0, 0}, 0);
}
# | 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... |