Submission #648848

#TimeUsernameProblemLanguageResultExecution timeMemory
648848LitusianoCombo (IOI18_combo)C++17
0 / 100
1 ms208 KiB
#include "combo.h" #include<bits/stdc++.h> using namespace std; //string S = "ABB"; /*int press(string s){ string x; for(int i = 1; i<=s.size(); ++i){ x+=S[i-1]; if(!s.find(x)) return i-1; } return 0; }*/ string guess_sequence(int N){ string ans; for(int i = 1; i<=N; ++i){ string ans1 = ans; string ans2 = ans; ans1+='A'; ans2+='B'; if(i == 2) cout<<ans1+ans2<<" "<<press(ans1+ans2)<<endl; if(press(ans1+ans2) == i){ if(press(ans1) == i) ans+='A'; else ans+='B'; } else{ ans1[i-1] ='X'; if(press(ans1) == i) ans+='X'; else ans+='Y'; } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...