Submission #989952

#TimeUsernameProblemLanguageResultExecution timeMemory
989952AcanikolicCombo (IOI18_combo)C++14
0 / 100
0 ms344 KiB
#include <bits/stdc++.h> #include "combo.h" #define pb push_back using namespace std; std::string guess_sequence(int N) { string sol; if(press(sol + 'A' + 'B')) { if(press(sol + 'A')) sol += 'A'; else sol += 'B'; }else { if(press(sol + 'X')) sol += 'X'; else sol += 'Y'; } vector<char>vec; if(sol[0] != 'A') vec.pb('A'); if(sol[0] != 'B') vec.pb('B'); if(sol[0] != 'X') vec.pb('X'); if(sol[0] != 'Y') vec.pb('Y'); for(int i = 2; i <= N - 1; i++) { int X = press(sol + vec[0] + sol + vec[1] + vec[0] + sol + vec[1] + vec[1] + sol + vec[1] + vec[2]); if(X == i) { sol += vec[0]; }else if(X == i + 1) { sol += vec[1]; }else { sol += vec[2]; } } if(press(sol + "AB") == N) { if(press(sol + 'A') == N) sol += 'A'; else sol += 'B'; }else { if(press(sol + 'X') == N) sol += 'X'; else sol += 'Y'; } return sol; } //4 * (n - 2) + 7 = 4n - 1
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...