Submission #432863

#TimeUsernameProblemLanguageResultExecution timeMemory
432863KalasLavasCombo (IOI18_combo)C++17
100 / 100
46 ms604 KiB
#include<bits/stdc++.h> #include"combo.h" using namespace std; // press(string) -> int string guess_sequence(int N) { string s = (press("AB")?(press("A")?"A":"B"):(press("X")?"X":"Y")); string q; if(N==1) return s; for(char i : "ABXY") if(i!=s[0]) q+=i; ///cerr<<q<<endl; for(int i=2;i<=N-1;i++) { int x = press(s+q[1]+s+q[2]+q[0]+s+q[2]+q[1]+s+q[2]+q[2]); s+=q[x-s.size()]; } if(press(s+q[0]) == N) s+=q[0]; else if(press(s+q[1]) == N) s+=q[1]; else s+=q[2]; //cerr<<s<<endl; return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...