Submission #110013

#TimeUsernameProblemLanguageResultExecution timeMemory
110013mefbayarCombo (IOI18_combo)C++14
100 / 100
45 ms564 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string s; char c[4]; string guess_sequence(int N){ int k; if(press("AB")){ if(press("A")){ c[0]='B'; c[1]='X'; c[2]='Y'; s="A"; }else{ c[0]='A'; c[1]='X'; c[2]='Y'; s="B"; } }else{ if(press("X")){ c[0]='B'; c[1]='A'; c[2]='Y'; s="X"; }else{ c[0]='A'; c[1]='X'; c[2]='B'; s="Y"; } } if(N==1) return s; for(int i = 2; i < N; i++){ k = press(s + c[0] + c[1] + s + c[0] + c[0] + s + c[0] + c[2] + s + c[1]); if(k == i + 1){ s += c[0]; } else if(k == i){ 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...