Submission #108122

#TimeUsernameProblemLanguageResultExecution timeMemory
108122autumn_eelCombo (IOI18_combo)C++14
5 / 100
2 ms276 KiB
#include <bits/stdc++.h> #define rep(i,n)for(int i=0;i<(n);i++) using namespace std; #include "combo.h" string s="ABXY"; string guess_sequence(int N) { char c='?'; rep(i,3){ string ask;ask+=s[i]; int res=press(ask); if(res){ c=s[i]; break; } } if(c=='?')c=s[3]; string ans;ans+=c; string t; rep(i,4){ if(s[i]!=c)t+=s[i]; } for(int i=1;i<N-1;i++){ string ask=ans+t[0]; rep(j,3)ask+=ans+t[1]+t[j]; int res=press(ask); if(res==i){ ans+=t[2]; } else if(res==i+1){ ans+=t[0]; } else if(res==i+2){ ans+=t[1]; } else abort(); } char last='?'; rep(i,2){ int res=press(ans+t[i]); if(res==N){ last=t[i]; break; } } if(last=='?')last=t[2]; ans+=last; return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...