제출 #712026

#제출 시각아이디문제언어결과실행 시간메모리
712026alvingogo콤보 (IOI18_combo)C++14
100 / 100
36 ms572 KiB
#include <bits/stdc++.h> #include "combo.h" #pragma GCC optimize("Ofast") #define AquA cin.tie(0);ios_base::sync_with_stdio(0); #define fs first #define sc second #define p_q priority_queue using namespace std; string guess_sequence(int n){ string s="AB"; int u=press(s); string ans; if(u){ s="A"; u=press(s); if(u){ ans+='A'; } else{ ans+='B'; } } else{ s="X"; u=press(s); if(u){ ans+='X'; } else{ ans+='Y'; } } if(n==1){ return ans; } char d='$',e='$',f='$'; string v="ABXY"; for(int i=0;i<4;i++){ if(v[i]==ans[0]){ continue; } if(d=='$'){ d=v[i]; } else if(e=='$'){ e=v[i]; } else if(f=='$'){ f=v[i]; } } for(int i=1;i<n-1;i++){ string z=ans+d+ans+e+d+ans+e+e+ans+e+f; u=press(z); if(u==i+1){ ans+=d; } else if(u==i+2){ ans+=e; } else{ ans+=f; } } string y=ans+d; if(press(y)==n){ ans+=d; } else{ string t=ans+e; if(press(t)==n){ ans+=e; } else{ ans+=f; } } return ans; } //
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...