Submission #983575

#TimeUsernameProblemLanguageResultExecution timeMemory
983575user736482Combo (IOI18_combo)C++17
0 / 100
10 ms1276 KiB
#include <bits/stdc++.h> #include <combo.h> using namespace std; string guess_sequence(int N){ string result; int guessresult; guessresult = press("AB"); if(guessresult){ guessresult = press("A"); if(guessresult) result = "A"; else result = "B"; } else{ guessresult = press("X"); if(guessresult) result = "X"; else result = "Y"; } if(N==1) return result; if(result[0]=='A') for(int i=0;i<N-2;i++){ guessresult = press(result + "B" + result + "XB" + result + "XX" + result + "XY"); if(guessresult == (int)result.size()-1){ result.push_back('B'); } else if(guessresult == (int)result.size()){ result.push_back('Y'); } else{ result.push_back('X'); } } if(result[0]=='B') for(int i=0;i<N-2;i++){ guessresult = press(result + "A" + result + "XA" + result + "XX" + result + "XY"); if(guessresult == (int)result.size()-1){ result.push_back('A'); } else if(guessresult == (int)result.size()){ result.push_back('Y'); } else{ result.push_back('X'); } } else if(result[0]=='X') for(int i=0;i<N-2;i++){ guessresult = press(result + "B" + result + "AB" + result + "AA" + result + "AY"); if(guessresult == (int)result.size()-1){ result.push_back('B'); } else if(guessresult == (int)result.size()){ result.push_back('Y'); } else{ result.push_back('A'); } } else if(result[0]=='Y') for(int i=0;i<N-2;i++){ guessresult = press(result + "B" + result + "XB" + result + "XX" + result + "XA"); if(guessresult == (int)result.size()-1){ result.push_back('B'); } else if(guessresult == (int)result.size()){ result.push_back('A'); } else{ result.push_back('X'); } } if(result[0] == 'X'){ guessresult = press(result+"A"+result+"B"); if(guessresult == N){ guessresult = press(result+"A"); if(guessresult == N) result.push_back('A'); else result.push_back('B'); } else{ result.push_back('Y'); }} if(result[0] == 'Y'){ guessresult = press(result+"A"+result+"B"); if(guessresult == N){ guessresult = press(result+"A"); if(guessresult == N) result.push_back('A'); else result.push_back('B'); } else{ result.push_back('X'); }} if(result[0] == 'A'){ guessresult = press(result+"X"+result+"B"); if(guessresult == N){ guessresult = press(result+"X"); if(guessresult == N) result.push_back('X'); else result.push_back('B'); } else{ result.push_back('Y'); }} if(result[0] == 'B'){ guessresult = press(result+"A"+result+"X"); if(guessresult == N){ guessresult = press(result+"A"); if(guessresult == N) result.push_back('A'); else result.push_back('X'); } else{ result.push_back('Y'); }} return result; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...