# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1076364 | anango | Robot Contest (IOI23_robot) | C++17 | 117 ms | 5892 KiB |
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"
using namespace std;
#define set set_instruction
void program_pulibot() {
int Z = 3;
for (int col1=0; col1<Z; col1++) { //our cell
for (int col2=-2; col2<Z; col2++) { //W
for (int col3=-2; col3<Z; col3++) { //S
for (int col4=-2; col4<Z; col4++) { //E
for (int col5=-2; col5<Z; col5++) { //N
if (col3==-2 && col4==-2) {
set({col1,col2,col3,col4,col5},1,'T');
continue;
}
vector<int> state = {col1,col2,col3,col4,col5};
if (col1==1) {
//check if any neighbours have 0, if yes, go there
//otherwise, check if any neighbours have 1, if yes, go there and assign here 2
if (col3==0) {
set(state,1,'S');
continue;
}
if (col4==0) {
set(state,1,'E');
continue;
}
if (col2==1) {
set(state,2,'W');
continue;
}
if (col3==1) {
set(state,2,'S');
continue;
}
if (col4==1) {
set(state,2,'E');
continue;
}
if (col5==1) {
set(state,2,'N');
continue;
}
}
else if (col1==0) {
//check if any neighbours have 0, if yes, go there and assign 1
//else, assign 2 and check for any neighboring 1s and go there
if (col3==0) {
set(state,1,'S');
continue;
}
if (col4==0) {
set(state,1,'E');
continue;
}
if (col2==1) {
set(state,2,'W');
continue;
}
if (col3==1) {
set(state,2,'S');
continue;
}
if (col4==1) {
set(state,2,'E');
continue;
}
if (col5==1) {
set(state,2,'N');
continue;
}
}
else if (col1==2) {
//should not happen
continue;
}
}
}
}
}
}
}
# | 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... |