Submission #972875

#TimeUsernameProblemLanguageResultExecution timeMemory
972875tamir1Combo (IOI18_combo)C++17
5 / 100
1 ms596 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; std::string guess_sequence(int N) { if(N<3) return ""; string v,S,p; if(press("A")==1){ S="A"; v="BXY"; } else if(press("B")==1){ S="B"; v="AXY"; } else if(press("X")==1){ S="X"; v="ABY"; } else{ S="Y"; v="ABX"; } for(int i=1;i<N;i++){ bool ok=0; for(int j=0;j<=1;j++){ p=S; p+=v[j]; if(press(p)>i){ ok=1; S=p; break; } } if(!ok) S+=v[2]; } return S; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...