Submission #310846

#TimeUsernameProblemLanguageResultExecution timeMemory
310846skippreCombo (IOI18_combo)C++14
0 / 100
1 ms200 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int N) { string ans=""; char a, b, x, y; if(press("AB")) { x='X'; y='Y'; press("A") ? (a='A', b='B') : (a='B', b='A'); } else { a='X'; b='Y'; press("X") ? (a='X', b='Y') : (a='Y', b='X'); } ans+=a; if(N==1) return ans; for(int i=1; i<=N-2; i++) { string cur = ans+b+b + ans+x + ans+b+x + ans+b+y; int j=press(cur); if(j==i) ans+=y; else if(j==i+1) ans+=x; else ans+=b; } if(press(ans+b)==N) ans+=b; else if(press(ans+x)==N) ans+=x; else ans+=y; return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...