Submission #205928

#TimeUsernameProblemLanguageResultExecution timeMemory
205928dCoding콤보 (IOI18_combo)C++14
0 / 100
1 ms204 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; string guess_sequence(int n) { string ans = ""; int oup; oup = press("AB"); if(oup) { oup = press("A"); if(oup) ans += 'A'; else ans += 'B'; } else { oup = press("X"); if(oup) ans += 'X'; else ans += 'Y'; } const string oof = "ABXY"; string ask = ""; for(int i = 0; i < 4; i++) { if(ans[0] != oof[i]) ask += oof[i]; } for(int i = 1; i < n; i++) { string s1 = ans+ask[0]; string s2 = ans+ask[1]+ask[0]; string s3 = ans+ask[1]+ask[1]; string s4 = ans+ask[1]+ask[2]; oup = press(s1+s2+s3+s4); if(oup == i) ans += ask[2]; else if(oup == i+1) ans += ask[0]; else ans += ask[1]; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...