Submission #784815

#TimeUsernameProblemLanguageResultExecution timeMemory
784815omeroCombo (IOI18_combo)C++14
5 / 100
1 ms208 KiB
#include "combo.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; std::string guess_sequence(int N) { string s = "ABXY"; string S = ""; string t = ""; string A = ""; if(press("AB")){ if(press("A")){ S += s[0]; } else{ S += s[1]; } } else{ if(press("X")){ S += s[2]; } else{ S += s[3]; } } A += S[(int)S.size()-1]; for(int i=0;i<4;i++){ if(S[(int)S.size()-1] == s[i]){ for(int j=0;j<4;j++){ if(s[j] != s[i]){ t += s[j]; } } } } for(int i=1;i<N-1;i++){ string st = A+t[0]+A+t[1]+t[0]+A+t[1]+t[1]+A+t[1]+t[2]; int p = press(st); A += t[(p-i+2)%3]; } if(press(A+t[0]) == N){ A += t[0]; } else if(press(A+t[1]) == N){ A += t[1]; } else{ A += t[2]; } return A; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...