Submission #138896

#TimeUsernameProblemLanguageResultExecution timeMemory
138896HassoonyCombo (IOI18_combo)C++17
5 / 100
2 ms276 KiB
#include <bits/stdc++.h> #include "combo.h" //#include "grader.cpp" using namespace std; string K="ABXY",letters=""; string guess_sequence(int N) { string ans=""; int x = press("AB"); if(x){ x=press("A"); if(x)ans = "A"; else ans = "B"; } else{ x=press("X"); if(x)ans = "X"; else ans = "Y"; } for(auto pp:K){ if(pp != ans[0]) letters += pp; } string t1,t2,t3,t4; int n=N; for(int i=1;i<n-1;i++){ t1=t2=t3= ans + letters[0]; t1+=letters[0]; t2+=letters[1]; t3+=letters[2]; t4=ans; t4+=letters[1]; // cout<<t1<<t2<<t3<<t4<<endl; int x=press(t1+t2+t3+t4); if(x == i){ ans += letters[2]; } else if(x == i + 1){ ans += letters[1]; } else ans += letters[0]; } // cout<< ans<<endl; x=press(ans + letters[0]); if(x == n) return ans + letters[0]; x = press(ans + letters[1]); if(x == n) return ans + letters[1]; return ans + letters[2]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...