Submission #702434

#TimeUsernameProblemLanguageResultExecution timeMemory
702434kishtarn555Combo (IOI18_combo)C++14
100 / 100
32 ms608 KiB
#include "combo.h" using namespace std; string guess_sequence(int N) { string p = ""; if (press("AB")) { if (press("A")) { p="A"; } else { p="B"; } } else{ if (press("X")) { p="X"; } else { p="Y"; } } if (N==1) return p; string tmp="ABXY"; string chars=""; for (int i=0; i < 4; i++) { if (tmp[i]!=p[0]) { chars+=tmp[i]; } } string guess; for (int i = 1; i < N-1; ++i) { guess=""; for (int j=0; j < 3; j++) { guess += p+chars[0]+chars[j]; } guess += p+chars[1]; int x = press(guess); if (x == i+2) p+=chars[0]; else if (x == i+1) p+=chars[1]; else p+=chars[2]; } guess = p+chars[0]+p+chars[1]; if (press(guess)==N) { if (press(p+chars[0])==N) { p+=chars[0]; } else { p+=chars[1]; } } else { p+=chars[2]; } return p; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...