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 pb push_back
#define all(x) x.begin(),x.end()
#define ll long long
#define ff first
#define ss second
#define vi vector<int>
const int N = 3005;
const ll INF = 1e18;
map<vector<int>, bool> G;
void se(int x, vi a, vi b, vi c, vi d, int col, char go){
for(int l: a){
for(int l1: b){
for(int l2: c){
for(int l3: d){
vi f = {x, l, l1, l2, l3};
if(G[f]) continue;
G[f] = 1;
set_instruction({x, l, l1, l2, l3}, col, go);
}
}
}
}
}
void program_pulibot()
{
// start
vi bad, bound, emp, one, op, badb, threeorbadb, three, two;
two.pb(2);
bad.pb(-1);
bound.pb(-2);
one.pb(1);
three.pb(3);
threeorbadb.pb(-1);
threeorbadb.pb(-2);
threeorbadb.pb(3);
badb.pb(-1);
badb.pb(-2);
badb.pb(3);
emp.pb(0);
op.pb(0);
op.pb(1);
op.pb(2);
op.pb(3);
op.pb(-1);
op.pb(-2);
vi op2;
op2.pb(0);
op2.pb(1);
op2.pb(3);
op2.pb(-1);
op2.pb(-2);
// vi L, D, R, U;
int cur, col;
char go;
char l = 'W', r = 'E', d = 'S', u = 'N', t = 'T', st = 'H';
// finish
se(0, op, bound, bound, op, 1, st);
// // expand_two
se(0, op, op, emp, op, 2, r);
se(0, two, bad, badb, op2, 3, l);
se(0, op2, bad, badb, two, 3, u);
se(0, op, emp, threeorbadb, op, 2, d);
se(0, two, badb, badb, op, 3, l);
se(0, op, badb, badb, two, 3, u);
// // one?
se(2, op, one, three, op, 1, r);
se(2, op, emp, three, op, 2, d);
// //three clearing
se(3, one, three, op, op, 3, d);
se(3, three, three, op, op, 3, d);
se(3, one, op, three, op, 3, r);
se(3, three, op, three, op, 3, r);
se(3, op, three, op, one, 3, d);
se(3, op, three, op, three, 3, d);
se(3, op, op, three, one, 3, r);
se(3, op, op, three, three, 3, r);
// // 1 eating
vi badbe;
badbe.pb(0);
badbe.pb(-1);
badbe.pb(-2);
badbe.pb(3);
se(1, one, badbe, badbe, op, 0, l);
se(1, three, badbe, badbe, op, 0, l);
se(1, op, badbe, badbe, one, 0, u);
se(1, op, badbe, badbe, three, 0, u);
se(3, three, badbe, badbe, op, 1, st);
se(3, one, badbe, badbe, op, 1, st);
se(3, op, badbe, badbe, three, 1, st);
se(3, op, badbe, badbe, one, 1, st);
se(2, two, three, op, op2, 3, l);
se(2, two, op, three, op2, 3, l);
se(2, op2, three, op, two, 3, u);
se(2, op2, op, three, two, 3, u);
// // 1 eats 2
se(1, two, op, op, op2, 1, l);
se(1, op2, op, op, two, 1, u);
se(2, two, one, op, op, 1, l);
se(2, two, op, one, op, 1, l);
se(2, op, one, op, two, 1, u);
se(2, op, op, one, two, 1, u);
// // termintion
se(2, bound, op, op, bound, 1, t);
se(0, op, op, op, op, 1, t);
se(1, op, op, op, op, 1, t);
se(2, op, op, op, op, 1, t);
se(3, op, op, op, op, 1, t);
}
Compilation message (stderr)
robot.cpp: In function 'void program_pulibot()':
robot.cpp:64:7: warning: unused variable 'cur' [-Wunused-variable]
64 | int cur, col;
| ^~~
robot.cpp:64:12: warning: unused variable 'col' [-Wunused-variable]
64 | int cur, col;
| ^~~
robot.cpp:65:8: warning: unused variable 'go' [-Wunused-variable]
65 | char go;
| ^~
# | 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... |