Submission #849082

#TimeUsernameProblemLanguageResultExecution timeMemory
849082abcvuitunggioCombo (IOI18_combo)C++17
100 / 100
13 ms2108 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int N){ string S; if (press("AB")) S+='A'+press("B"); else S+='X'+press("Y"); if (N==1) return S; string b="ABXY",c; for (char i:b) if (i!=S[0]) c+=i; for (int i=1;i<N-1;i++){ int val=press(S+c[0]+S+c[1]+c[0]+S+c[1]+c[1]+S+c[1]+c[2]); if (val==i+1) S+=c[0]; else if (val==i+2) S+=c[1]; else S+=c[2]; } if (press(S+c[0])==N) S+=c[0]; else if (press(S+c[1])==N) S+=c[1]; else S+=c[2]; return S; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...