This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "combo.h"
#include<bits/stdc++.h>
using namespace std;
std::string guess_sequence(int n)
{
vector<string> controls{"A", "B", "X", "Y"};
string ans;
for(int i=0;i<3;i++)
if(press(controls[i]))
ans += controls[i];
if(ans.empty())
ans += controls[3];
remove(controls.begin(), controls.end(), ans);
if(n == 1)
return ans;
for(int i=0;i<n-1;i++)
{
int x = i + 2;
int len = press(ans + controls[1] + ans + controls[0] + controls[0] + ans + controls[0] + controls[1] + ans + controls[0] + controls[2]);
ans += controls[len - x];
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |