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;
string guess_sequence(int N) {
string ans = "";
if(press("AB") == 1){
if(press("A") == 1){
ans += 'A';
}
else{
ans += 'B';
}
}
else{
if(press("X") == 1){
ans += 'X';
}
else{
ans += 'Y';
}
}
vector<char> v = {'A', 'B', 'X', 'Y'};
v.erase(find(v.begin(), v.end(), ans[0]));
for (int i = 2; i <= N; i++)
{
string help = "";
help += ans;
help += v[0];
for (int j = 0; j < 3; j++)
{
help += ans;
help += v[1];
help += v[j];
}
int coins = press(help);
if(coins == i){
ans += v[0];
}
else if(coins == i + 1){
ans += v[1];
}
else{
ans += v[2];
}
}
return ans;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |