Submission #713272

#TimeUsernameProblemLanguageResultExecution timeMemory
713272europiumCombo (IOI18_combo)C++17
0 / 100
56 ms208 KiB
#include <iostream> #include <vector> #include <algorithm> #include <string> #include <numeric> #include <cmath> #include <iterator> #include <set> #include <map> #include <math.h> #include <iomanip> #include <unordered_set> #include "combo.h" using namespace std; string guess_sequence(int n) { vector<string> moves = {"A", "B", "X", "Y"}; string s = ""; for (int i = 0; i < 3; i++){ string guess = moves[i]; if (press(guess) == 1){ s += moves[i]; auto it = find(moves.begin(), moves.end(), guess); moves.erase(it); break; } } while (int(s.size()) < n - 1){ string guess = s + moves[0] + s + moves[1] + moves[0] + s + moves[1] + moves[1] + s + moves[1] + moves[2]; int coins = press(guess); if (coins == int(s.size())) s += moves[2]; else if (coins == int(s.size()) + 1) s += moves[0]; else if (coins == int(s.size()) + 2) s += moves[1]; } for (int i = 0; i < 3; i++){ string guess = s + moves[i]; if (press(guess) == int(s.size()) + 1){ s += moves[i]; break; } } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...