제출 #1088019

#제출 시각아이디문제언어결과실행 시간메모리
1088019Valaki2로봇 대회 (IOI23_robot)C++17
15 / 100
301 ms10100 KiB
#include "robot.h" #include <bits/stdc++.h> using namespace std; const int Zmax = 19; #define all(x) for(int x = -2; x <= Zmax; x++) #define do(x, y) set_instruction({a, b, c, d, e}, x, y) vector<char> step = {' ', ' ', 'W', 'S', 'E', 'N'}; vector<int> rev = {0, 3, 4, 1, 2}; void program_pulibot() { /*all(a) { all(b) { int c = -2, d = -2; all(e) { do(1, 'T'); } } }*/ vector<int> s(5); all(a) { if(a < 0) { continue; } all(b) { all(c) { all(d) { all(e) { if(c == -2 && d == -2) { continue; } if(e == 1 || b == 1 || c == 1 || d == 1) { if(b == -2 && e == -2) { do(1, 'T'); } else { if(a >= 2 && a <= 5) { do(1, step[a]); } } } else { s[0] = a, s[1] = b, s[2] = c, s[3] = d, s[4] = e; int par = 0; for(int i = 1; i <= 4; i++) { if(s[i] != rev[i] + 1 && s[i] >= 2) { par = i; break; } } if(par == 0) { par = 4; } bool good = false; for(int i = 1; i <= 4; i++) { if(s[i] == 0) { do(par + 1, step[i + 1]); good = true; break; } } if(!good) { do(par + 1, step[par + 1]); } } } } } } } all(a) { all(b) { int c = -2, d = -2; all(e) { s[0] = a, s[1] = b, s[2] = c, s[3] = d, s[4] = e; if(a != 0) { continue; } int par = 0; for(int i = 1; i <= 4; i++) { if(s[i] >= 2) { par = i; break; } } if(par == 0) { par = 4; } do(1, step[par + 1]); } } } } /* all(a) { all(b) { all(c) { all(d) { all(e) { // } } } } } */
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...