제출 #1158730

#제출 시각아이디문제언어결과실행 시간메모리
1158730The_Samurai로봇 대회 (IOI23_robot)C++20
15 / 100
66 ms5632 KiB
#include "robot.h" #include "bits/stdc++.h" using namespace std; pair<int, char> bad = make_pair(-1, 'A'); vector<char> ord = {'W', 'S', 'E', 'N'}; pair<int, char> get(int now, int w, int s, int e, int n) { if (s == -2 and e == -2) return make_pair(1, 'T'); vector<int> vec = {w, s, e, n}; if (count(vec.begin(), vec.end(), 1) > 1) return bad; if (count(vec.begin(), vec.end(), 1) == 0) { if (w != -2 or n != -2) return bad; } // if (now == 0 and w == -1 and s == -2 and e == -1) { // cout << now << ' ' << w << ' ' << s << ' ' << e << ' ' << n << endl; // } for (int i = 0; i < vec.size(); i++) { if (vec[i] == 0) return make_pair(1, ord[i]); } for (int i = 0; i < vec.size(); i++) { if (vec[i] == 1) return make_pair(2, ord[i]); } return bad; } void program_pulibot() { bool found = false; for (int now = 0; now <= 1; now++) { for (int w = -2; w <= 2; w++) { for (int s = -2; s <= 2; s++) { for (int e = -2; e <= 2; e++) { for (int n = -2; n <= 2; n++) { auto it = get(now, w, s, e, n); if (it.first == -1) continue; found |= vector{0, -1, -2, -1, 1} == vector{now, w, s, e, n}; set_instruction({now, w, s, e, n}, it.first, it.second); } } } } } // cout << found << endl; }
#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...