Submission #521214

#TimeUsernameProblemLanguageResultExecution timeMemory
521214krit3379Combo (IOI18_combo)C++14
100 / 100
35 ms616 KiB
#include<bits/stdc++.h> using namespace std; #include<combo.h> #define N 305 string guess_sequence(int n){ int i,j,cnt; string s,t; if(press("AB")){ if(press("A"))s="A"; else s="B"; } else{ if(press("X"))s="X"; else s="Y"; } if(s!="A")t+="A"; if(s!="B")t+="B"; if(s!="X")t+="X"; if(s!="Y")t+="Y"; if(n==1)return s; for(i=2;i<n;i++){ string temp=s; for(j=0;j<3;j++){ temp+=t[0]; temp+=t[j]; temp+=s; } temp+=t[1]; cnt=press(temp); if(cnt==i+1)s+=t[0]; else if(cnt==i)s+=t[1]; else s+=t[2]; } if(press(s+t[0]+s+t[1])==n){ if(press(s+t[0])==n)return s+t[0]; return s+t[1]; } else return s+t[2]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...