#include "robot.h"
#include <bits/stdc++.h>
using namespace std;
void build( vector<int> o, vector<int> w, vector<int> s, vector<int> l, vector<int> n, int cor, char letra ){
for( int a : o ) for( int b : w ) for( int c : s ) for( int d : l ) for( int e : n )
set_instruction({ a, b, c, d, e }, cor, letra );
}
void solve0(){
vector<int> cores = {-2, -1, 0, 1, 2, 3};
vector<char> letra = {'H', 'W', 'S', 'E', 'N'};
map<int, int> cont;
vector<int> estado(1,0);
for( int w : cores ){
estado.push_back(w);
for( int s : cores ){
estado.push_back(s);
for( int e : cores ){
estado.push_back(e);
for( int n : cores ){
estado.push_back(n);
cont.clear();
for( int i = 1; i < 5; i++ ) cont[estado[i]]++;
if( e == -2 && s == -2 ){
set_instruction( estado, 1, 'T' );
}
else if( cont[0] > 0 ){
int i = 1;
while( estado[i] != 0 ) i++;
set_instruction( estado, 1, letra[i] );
}
else if( cont[1] > 0 ){
int i = 1;
while( estado[i] != 1 ) i++;
set_instruction( estado, 2, letra[i] );
}
estado.pop_back();
}
estado.pop_back();
}
estado.pop_back();
}
estado.pop_back();
}
}
void solve1(){
vector<int> cores = {-2, -1, 0, 1, 2, 3};
vector<char> letra = {'H', 'W', 'S', 'E', 'N'};
map<int, int> cont;
vector<int> estado(1,1);
for( int w : cores ){
estado.push_back(w);
for( int s : cores ){
estado.push_back(s);
for( int e : cores ){
estado.push_back(e);
for( int n : cores ){
estado.push_back(n);
cont.clear();
for( int i = 1; i < 5; i++ ) cont[estado[i]]++;
if( e == -2 && s == -2 ){
set_instruction( estado, 1, 'T' );
}
else if( cont[0] > 0 ){
int i = 1;
while( estado[i] != 0 ) i++;
set_instruction( estado, 1, letra[i] );
}
else if( cont[1] > 0 ){
int i = 1;
while( estado[i] != 1 ) i++;
set_instruction( estado, 2, letra[i] );
}
estado.pop_back();
}
estado.pop_back();
}
estado.pop_back();
}
estado.pop_back();
}
}
void program_pulibot(){
solve0();
solve1();
}
# | 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... |