# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1029857 | Andrey | 로봇 대회 (IOI23_robot) | C++17 | 146 ms | 6324 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "robot.h"
#include<bits/stdc++.h>
using namespace std;
bool check(int a, int x) {
if(a >= 2 && a <= 5 && (a-x+1002)%4 == 0) {
return true;
}
return false;
}
void program_pulibot()
{
char dir[6] = {'z','T','W','S','E','N'};
for(int c = 0; c <= 7; c++) {
for(int w = -2; w <= 7; w++) {
for(int s = -2; s <= 7; s++) {
for(int e = -2; e <= 7; e++) {
for(int n = -2; n <= 7; n++) {
if(c == 0) {
if(s == -2 && e == -2) {
set_instruction({c,w,s,e,n},6,'H');
continue;
}
if(w == -2 && n == -2) {
set_instruction({c,w,s,e,n},2,'H');
}
else if(check(w,2)) {
set_instruction({c,w,s,e,n},2,'W');
}
else if(check(s,3)) {
set_instruction({c,w,s,e,n},3,'S');
}
else if(check(e,4)) {
set_instruction({c,w,s,e,n},4,'E');
}
else if(check(n,5)) {
set_instruction({c,w,s,e,n},5,'N');
}
continue;
}
if(c == 1) {
if(s == -2 && e == -2) {
set_instruction({c,w,s,e,n},1,'T');
continue;
}
if(w == 6) {
set_instruction({c,w,s,e,n},1,'W');
}
else if(s == 6) {
set_instruction({c,w,s,e,n},1,'S');
}
else if(e == 6) {
set_instruction({c,w,s,e,n},1,'E');
}
else if(n == 6) {
set_instruction({c,w,s,e,n},1,'N');
}
continue;
}
if(c == 6) {
if(w == 1 || s == 1 || e == 1 || n == 1) {
set_instruction({c,w,s,e,n},7,'H');
continue;
}
if(w == -2 && n == -2) {
set_instruction({c,w,s,e,n},7,'H');
continue;
}
if(check(w,2)) {
set_instruction({c,w,s,e,n},6,'W');
}
else if(check(s,3)) {
set_instruction({c,w,s,e,n},6,'S');
}
else if(check(e,4)) {
set_instruction({c,w,s,e,n},6,'E');
}
else if(check(n,5)) {
set_instruction({c,w,s,e,n},6,'N');
}
else {
if(w == 6) {
set_instruction({c,w,s,e,n},0,'W');
}
else if(s == 6) {
set_instruction({c,w,s,e,n},0,'S');
}
else if(e == 6) {
set_instruction({c,w,s,e,n},0,'E');
}
else if(n == 6) {
set_instruction({c,w,s,e,n},0,'N');
}
}
continue;
}
if(c == 7) {
if((n == -2 && w == -2) || ((w == 6 || s == 6 || e == 6 || n == 6) && (w == 1 || s == 1 || e == 1 || n == 1))) {
if(w == 7) {
set_instruction({c,w,s,e,n},7,'W');
continue;
}
else if(s == 7) {
set_instruction({c,w,s,e,n},7,'S');
continue;
}
else if(e == 7) {
set_instruction({c,w,s,e,n},7,'E');
continue;
}
if(n == 7) {
set_instruction({c,w,s,e,n},7,'N');
continue;
}
}
if(check(w,2) || w == 8) {
set_instruction({c,w,s,e,n},7,'W');
}
else if(check(s,3) || s == 8) {
set_instruction({c,w,s,e,n},7,'S');
}
else if(check(e,4) || e == 8) {
set_instruction({c,w,s,e,n},7,'E');
}
else if(check(n,5) || n == 8) {
set_instruction({c,w,s,e,n},7,'N');
}
else {
if(w == 7) {
set_instruction({c,w,s,e,n},0,'W');
}
else if(s == 7) {
set_instruction({c,w,s,e,n},0,'S');
}
else if(e == 7) {
set_instruction({c,w,s,e,n},0,'E');
}
else if(n == 7) {
set_instruction({c,w,s,e,n},0,'N');
}
else {
set_instruction({c,w,s,e,n},1,'H');
}
}
continue;
}
if(w == 7 || s == 7 || e == 7 || n == 7) {
set_instruction({c,w,s,e,n},7,'H');
continue;
}
int br = 0;
if(s == 6) {
br++;
}
if(w == 6) {
br++;
}
if(e == 6) {
br++;
}
if(n == 6) {
br++;
}
if(br == 1) {
set_instruction({c,w,s,e,n},6,'H');
continue;
}
int p,x;
if(br == 0) {
p = c+1;
}
else if(br >= 2) {
p = c;
}
if(p == 6) {
p = 2;
}
if(p == 2) {
x = w;
}
else if(p == 3) {
x = s;
}
else if(p == 4) {
x = e;
}
else if(p == 5) {
x = n;
}
if(br >= 2) {
set_instruction({c,w,s,e,n},7,dir[p]);
}
else {
if(x == 0 || check(x,p)) {
set_instruction({c,w,s,e,n},p,dir[p]);
}
else {
set_instruction({c,w,s,e,n},p,'H');
}
}
}
}
}
}
}
}
컴파일 시 표준 에러 (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... |