제출 #130131

#제출 시각아이디문제언어결과실행 시간메모리
130131HungAnhGoldIBO2020콤보 (IOI18_combo)C++14
100 / 100
61 ms2120 KiB
#include<iostream> #include "combo.h" using namespace std; char ohyeah[]={'X','Y','A','B'}; char lis[5]; string guess_sequence(int N){ string cac="",cac1; if(press("AB")){ if(press("A")){ cac+='A'; } else{ cac+='B'; } } else{ if(press("X")){ cac+='X'; } else{ cac+='Y'; } } if(N==1){ return cac; } int i,j=0; for(i=0;i<4;i++){ if(ohyeah[i]!=cac[0]){ j++; lis[j]=ohyeah[i]; } } for(i=1;i<N-1;i++){ cac1=cac+lis[1]+cac+lis[2]+lis[3]+cac+lis[2]+lis[1]+cac+lis[2]+lis[2]; j=press(cac1); if(j==i+1){ cac+=lis[1]; } else{ if(j==i){ cac+=lis[3]; } else{ cac+=lis[2]; } } } if(press(cac+lis[1])==N){ return cac+lis[1]; } if(press(cac+lis[2])==N){ return cac+lis[2]; } return cac+lis[3]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...