Submission #1082291

#TimeUsernameProblemLanguageResultExecution timeMemory
1082291mickey080929Robot Contest (IOI23_robot)C++17
6 / 100
124 ms7360 KiB
#include "robot.h" #include <bits/stdc++.h> using namespace std; char dir[] = {' ', 'W', 'S', 'E', 'N'}; void set_instruction(std::vector<int> S, int Z, char A); pair<int,char> cal(vector<int> S) { if (S[1] == 1 || S[2] == 1 || S[3] == 1 || S[4] == 1) { for (int i=1; i<=4; i++) { if (S[i] >= 7 && S[i] - 6 == i) { return {6, dir[i]}; } } for (int i=1; i<=4; i++) { if (2 <= S[i] && S[i] <= 5) { return {1, dir[i]}; } } return {1, 'T'}; } if (S[0] == 6) { for (int i=1; i<=4; i++) { if (S[i] >= 7 && S[i] - 6 == i) { return {6, dir[i]}; } } for (int i=1; i<=4; i++) { int oth = (i - 1 + 2) % 4 + 1; if (2 <= S[i] && S[i] <= 5 && S[i] == oth+1) { return {oth + 6, dir[i]}; } } return {1, 'T'}; } if (S[0] >= 7) { for (int i=1; i<=4; i++) { if (S[i] == 6) { return {0, dir[i]}; } } return {1, 'T'}; } if (S[2] == -2 && S[3] == -2) { for (int i=1; i<=4; i++) { if (2 <= S[i] && S[i] <= 5) { return {1, dir[i]}; } } } vector<int> is = {2, 3}; random_shuffle(is.begin(), is.end()); for (auto &i : is) { if (S[i] == 0) { return {i+1, dir[i]}; } } return {6, 'H'}; } void program_pulibot() { int MX = 10; for (int a=-2; a<=MX; a++) { for (int b=-2; b<=MX; b++) { for (int c=-2; c<=MX; c++) { for (int d=-2; d<=MX; d++) { for (int e=-2; e<=MX; e++) { auto ret = cal({a, b, c, d, e}); set_instruction({a, b, c, d, e}, ret.first, ret.second); } } } } } }
#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...