Submission #644550

#TimeUsernameProblemLanguageResultExecution timeMemory
644550tigarCombo (IOI18_combo)C++14
0 / 100
1 ms208 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int N) { string rezz=""; char slova[]={'A', 'B', 'X', 'Y'}; int begg=0; int br=press("AB"); if(br>=1) { br=press("A"); if(br==1){rezz+="A"; begg=0;} else {rezz+="B"; begg=1;} } else if(br==0) { br=press("X"); if(br==1){rezz+="X"; begg=2;} else {rezz+="Y"; begg=3;} } for(int i=1; i<N-1; i++) { string prs=rezz+slova[(begg+1)%4]+slova[(begg+1)%4]; prs+=rezz+slova[(begg+1)%4]+slova[(begg+2)%4]; prs+=rezz+slova[(begg+1)%4]+slova[(begg+3)%4]; prs+=rezz+slova[(begg+2)%4]; int lnght=press(prs); if(lnght==i+2)rezz+=slova[(begg+1)%4]; else if(lnght==i+1)rezz+=slova[(begg+2)%4]; else rezz+=slova[(begg+3)%4]; } int num=press(rezz+slova[(begg+1)%4]+rezz+slova[(begg+2)%4]); if(num==N-1)rezz+slova[(begg+3)%4]; else { num=press(rezz+slova[(begg+1)%4]); if(num==N-1)rezz+slova[(begg+2)%4]; else rezz+slova[(begg+1)%4]; } return rezz; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...