Submission #78859

#TimeUsernameProblemLanguageResultExecution timeMemory
78859renatsjCombo (IOI18_combo)C++14
30 / 100
70 ms548 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; string S,s; char c[3]; int k,i; std::string guess_sequence(int N) { c[0]='A'; c[1]='B'; c[2]='X'; k=press("AB"); if (k==0) { if (press("X")==1) {S="X"; c[2]='Y';} else {S="Y";} } else { if (k==2) {S="AB"; c[0]='Y';} else { if (press("A")==1) {S="A"; c[0]='Y';} else {S="B"; c[1]='Y';} } } i=S.length(); while (i<N) { k=press(S+c[0]); if (k>i) {S+=c[0];} else {if (press(S+c[1])>i) {S+=c[1];} else {S+=c[2];}} ++i; } return S; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...