Submission #862858

#TimeUsernameProblemLanguageResultExecution timeMemory
86285820163070Combo (IOI18_combo)C++14
5 / 100
1 ms356 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; std::string guess_sequence(int N) { string f; string s; if(press("AB")) { if(press("A")) f="A",s="BXY"; else f="B",s="AXY"; } else { if(press("X")) f="X",s="ABY"; else f="Y",s="ABX"; } string ans; ans+=f; for(int i=2;i<N;i++) { string t=ans+s[0]+ans+s[1]+s[0]+ans+s[1]+s[1]+ans+s[1]+s[2]; int get=press(t); if(get==i-1) ans+=s[2]; else if(get==i) ans+=s[0]; else ans+=s[1]; } if(press(ans+s[0])==N) ans+=s[0]; else if(press(ans+s[1])==N) ans+=s[1]; else ans+=s[2]; return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...