Submission #583887

#TimeUsernameProblemLanguageResultExecution timeMemory
583887LIFCombo (IOI18_combo)C++14
10 / 100
75 ms624 KiB
#include "combo.h" std::string guess_sequence(int N) { std::string p = ""; int n = N; char k[4] = {'A','B','X','Y'}; int first=999; for(int i=0;i<3;i++) { std:: string ss = p; ss = ss + k[i]; int kk = press(ss); if(kk == 1) { first = i; break; } } if(first == 999 )//that means first haven't been changed { first = 3; } p = p + k[first]; for(int i=1;i<n;i++) { int flag = 0; for(int j=0;j<3;j++) { if(j == first)continue; std::string ss = p; ss = ss + k[j]; if(press(ss) == i+1) { flag = 1; p = p + k[j]; break; } } if(flag == 0) { p = p + k[3]; } } return p; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...