# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1026056 | Andrey | Robot Contest (IOI23_robot) | C++17 | 124 ms | 6836 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"
#include<bits/stdc++.h>
using namespace std;
void program_pulibot()
{
/*set_instruction({0, -2, -1, 0, -2}, 1, 'E');
set_instruction({0, 1, -1, 0, -2}, 1, 'E');
set_instruction({0, 1, 0, -2, -2}, 1, 'S');
set_instruction({0, -1, -2, -2, 1}, 1, 'T');*/
char dir[6] = {'z','T','W','S','E','N'};
for(int c = -2; c < 10; c++) {
for(int w = -2; w < 10; w++) {
for(int s = -2; s < 10; s++) {
for(int e = -2; e < 10; e++) {
for(int n = -2; n < 10; n++) {
if(c < 0) {
continue;
}
if(c == 0) {
if(n == -2 && w == -2) {
set_instruction({c,w,s,e,n},6,'H');
}
else {
if(w > 5) {
set_instruction({c,w,s,e,n},2,'W');
}
else if(s > 5) {
set_instruction({c,w,s,e,n},3,'S');
}
else if(e > 5) {
set_instruction({c,w,s,e,n},4,'E');
}
else if(n > 5) {
set_instruction({c,w,s,e,n},5,'N');
}
}
continue;
}
if(w == 1 || s == 1 || e == 1 || n == 1) {
if(w > 5) {
set_instruction({c,w,s,e,n},1,'W');
}
else if(s > 5) {
set_instruction({c,w,s,e,n},1,'S');
}
else if(e > 5) {
set_instruction({c,w,s,e,n},1,'E');
}
else if(n > 5) {
set_instruction({c,w,s,e,n},1,'N');
}
else {
set_instruction({c,w,s,e,n},1,'T');
}
continue;
}
if(s == -2 && e == -2) {
if(n > 5) {
set_instruction({c,w,s,e,n},1,'N');
}
else {
set_instruction({c,w,s,e,n},1,'W');
}
continue;
}
int p = c;
char a;
if(p > 5) {
p-=4;
}
p++;
if(p == 6) {
p-=4;
}
int x;
if(p == 2) {
x = w;
}
else if(p == 3) {
x = s;
}
else if(p == 4) {
x = e;
}
else {
x = n;
}
if(x < 0) {
set_instruction({c,w,s,e,n},p+4,'H');
}
else {
if((x-p+1002)%4 == 0 || x == 0) {
if(x > 5) {
set_instruction({c,w,s,e,n},p,dir[p]);
}
else {
set_instruction({c,w,s,e,n},p+4,dir[p]);
}
}
else {
set_instruction({c,w,s,e,n},p+4,'H');
}
}
}
}
}
}
}
}
Compilation message (stderr)
# | 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... |