Submission #518820

#TimeUsernameProblemLanguageResultExecution timeMemory
518820alexx_stefanCombo (IOI18_combo)C++17
5 / 100
1 ms200 KiB
#include<bits/stdc++.h> #include "combo.h" using namespace std; string guess_sequence(int n) { int r = press("AB"); vector <char> opt; string sir; if (r == 0) { r = press ("X"); opt.push_back('A'); opt.push_back('B'); if (r == 1) { sir+="X"; opt.push_back('Y'); } else { sir += "Y"; opt.push_back('X'); } } else { r = press ("A"); opt.push_back('X'); opt.push_back('Y'); if (r == 1) { sir+="A"; opt.push_back('B'); } else { sir += "B"; opt.push_back('A'); } } for (int pas = 2; pas < n; pas++) { string ask = sir + opt[0] + opt[0] + sir + opt[0] + opt[1] + sir + opt[0] + opt[2] + sir + opt[1]; r = press(ask); if (r == pas + 1) sir += opt[0]; else if (r == pas) sir += opt[1]; else sir += opt[2]; } string ask = sir + opt[0]; r = press(ask); if (r == n) sir += opt[0]; else { ask = sir + opt[1]; r = press(ask); if (r == n) sir += opt[1]; else sir += opt[2]; } return sir; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...