Submission #1038917

#TimeUsernameProblemLanguageResultExecution timeMemory
1038917ZicrusRobot Contest (IOI23_robot)C++17
25 / 100
95 ms5940 KiB
#include <bits/stdc++.h> #include "robot.h" using namespace std; typedef long long ll; // Cur, W, S, E, N unordered_set<ll> check; void instruct(vector<int> s, int z, char a, bool exp) { vector<int> nw; vector<vector<int>> scenarios(1, vector<int>(5)); for (int i = 0; i < 5; i++) { scenarios[0][i] = s[i] == -9 ? -2 : s[i]; } for (int i = 0; i < 5; i++) { ll sz = scenarios.size(); if (s[i] == -1 && !exp) { for (int j = 0; j < sz; j++) { nw = scenarios[j]; nw[i] = -2; scenarios.push_back(nw); nw[i] = 2; scenarios.push_back(nw); } } if (s[i] == -9) { for (int j = 0; j < sz; j++) { nw = scenarios[j]; nw[i] = -1; scenarios.push_back(nw); nw[i] = 0; scenarios.push_back(nw); nw[i] = 1; scenarios.push_back(nw); nw[i] = 2; scenarios.push_back(nw); } } } for (auto &e : scenarios) { ll id = ((e[0] & 15) << (4 * 4)) | ((e[1] & 15) << (4 * 3)) | ((e[2] & 15) << (4 * 2)) | ((e[3] & 15) << (4 * 1)) | ((e[4] & 15) << (4 * 0)); if (check.count(id)) continue; check.insert(id); set_instruction(e, z, a); } } // Cur, W, S, E, N void program_pulibot() { instruct({-9, -9, -2, -2, -9}, 1, 'T', false); instruct({-9, -9, -9, 0, -9}, 1, 'E', false); instruct({-9, -9, 0, -9, -9}, 1, 'S', false); instruct({-9, 0, -9, -9, -9}, 1, 'W', false); instruct({-9, -9, -9, -9, 0}, 1, 'N', false); instruct({-9, 1, -1, -1, -1}, 2, 'W', false); instruct({-9, -1, -1, -1, 1}, 2, 'N', false); instruct({-9, -1, -1, 1, -1}, 2, 'E', false); instruct({-9, -1, 1, -1, -1}, 2, 'S', false); }
#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...