Submission #278802

#TimeUsernameProblemLanguageResultExecution timeMemory
278802themax23Combo (IOI18_combo)C++17
30 / 100
59 ms580 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; std::string guess_sequence(int N) { //first part: Getting the first letter string first = ""; int fcoin = press("XY"); if (fcoin){ if(press("X")) first = "X"; else first = "Y"; } else{ if(press("A")) first = "A"; else first = "B"; } string posibles = "",ans = first; if(first == "A") posibles = "BXY"; else if(first == "B") posibles = "AXY"; else if(first == "X") posibles = "ABY"; else posibles = "ABX"; for(int i = 1; i < N; ++i){ string test = ans + posibles[0] + ans + posibles[1]; if(press(test) > i){ if(press(test.substr(0,i+1)) > i) ans += posibles[0]; else ans += posibles[1]; } else ans += posibles[2]; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...