제출 #1017858

#제출 시각아이디문제언어결과실행 시간메모리
1017858tmarcinkevicius로봇 대회 (IOI23_robot)C++17
6 / 100
101 ms5808 KiB
#include <bits/stdc++.h> using namespace std; #include "robot.h" typedef pair<int, int> pii; #define f first #define s second const int maxColor = 4; /* 0 - unvisited 1 - final 2 - explore 3 - bad way 4 - bad way fix */ void program_pulibot() { vector<int> S(5); vector<pair<int, char>> directions = { {3, 'E'}, {1, 'W'}, {2, 'S'}, {4, 'N'}}; for (S[0] = 0; S[0] <= maxColor; S[0]++) { for (S[1] = -2; S[1] <= maxColor; S[1]++) { for (S[2] = -2; S[2] <= maxColor; S[2]++) { for (S[3] = -2; S[3] <= maxColor; S[3]++) { for (S[4] = -2; S[4] <= maxColor; S[4]++) { if (S[0] == 4) { bool found = false; for (auto p : directions) { if (S[p.f] == 3) { set_instruction(S, 4, p.s); found = true; break; } } if (found) continue; found = false; for (auto p : directions) { if (S[p.f] == 4) { set_instruction(S, 0, p.s); found = true; break; } } if (found) continue; for (auto p : directions) { if (S[p.f] == 2) { set_instruction(S, 1, p.s); found = true; break; } } if (found) continue; if (S[1] == -2 && S[4] == -2) { set_instruction(S, 1, 'T'); } continue; } if (S[0] == 3) { bool found = false; for (auto p : directions) { if (S[p.f] == 3) { set_instruction(S, 4, p.s); found = true; break; } } if (found) continue; for (auto p : directions) { if (S[p.f] == 4) { set_instruction(S, 0, p.s); found = true; break; } } if (found) continue; if (S[1] == -2 && S[4] == -2) { set_instruction(S, 1, 'T'); } continue; } bool found1 = false; for (auto p : directions) { if (S[p.f] == 1) { found1 = true; break; } } if (found1) { bool found = false; for (auto p : directions) { if (S[p.f] == 3) { set_instruction(S, 4, p.s); found = true; break; } } if (found) continue; if (S[1] == -2 && S[4] == -2) { set_instruction(S, 1, 'T'); continue; } for (auto p : directions) { if (S[p.f] == 2) { set_instruction(S, 1, p.s); break; } } continue; } if (S[0] == 0 || S[0] == 2) { if (S[2] == -2 && S[3] == -2) { for (auto p : directions) { if (S[p.f] == 2) { set_instruction(S, 1, p.s); break; } } continue; } bool found = false; for (auto p : directions) { if (S[p.f] == 0 && p.s != 'N' && p.s != 'W') { set_instruction(S, 2, p.s); found = true; break; } } if (found) continue; for (auto p : directions) { if (S[p.f] == 2) { set_instruction(S, 3, p.s); break; } } } } } } } } }
#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...