Submission #239387

#TimeUsernameProblemLanguageResultExecution timeMemory
239387ctziapoCombo (IOI18_combo)C++14
10 / 100
119 ms576 KiB
#include "combo.h" using namespace std; std::string guess_sequence(int N) { std::string p = ""; string s; int t=press("AB"); if(t!=0){ int t2=press("A"); if(t2==1){ s="A"; } else s="B"; } else { int t2=press("X"); if(t2==1){ s="X"; } else s="Y"; } // cout<<"first letter is "<<s<<endl; int cou=1; string ans; ans=s; while(cou!=N){ string f; f=ans+"A"; if(press(f)==cou+1){ ans=f; cou++; continue; } f=ans+"B"; if(press(f)==cou+1){ ans=f; cou++; continue; } f=ans+"X"; if(press(f)==cou+1){ ans=f; cou++; continue; } f=ans+"Y"; if(press(f)==cou+1){ ans=f; cou++; continue; } } // cout<<"answeeer "<<ans<<endl; return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...