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 <iostream>
#include <algorithm>
#include <queue>
#include <cmath>
#include <vector>
#include <list>
#include <string>
#include <unordered_map>
#include <map>
#include <set>
#include <stack>
#include <string>
#include <iomanip>
#include <fstream>
using namespace std;
void fastio() {
ios_base::sync_with_stdio(false);
cin.tie(0);
}
const long long mod = 1e9+7;
const int N = 3e6+5;
int a[N] , dp[N];
string guess_sequence(int N){
string t;
char x[4];
if(press("A")){
t = "A";
x[0] = 'B';
x[1] = 'X';
x[2] = 'Y';
}
if(press("B")){
t = "B";
x[0] = 'A';
x[1] = 'X';
x[2] = 'Y';
}
if(press("X")){
t = "X";
x[0] = 'B';
x[1] = 'A';
x[2] = 'Y';
}
if(press("Y")){
t = "Y";
x[0] = 'B';
x[1] = 'X';
x[2] = 'A';
}
string s = t;
int num = 1;
for(int i = 2 ; i <= N ; i++){
int ans = press(s + x[0] + x[0] + s + x[0] + x[1] + s + x[0] + x[2] + s + x[1] + s);
if(ans == num){
s += x[2];
num++;
}
else if(ans == (num + 1)){
s += x[1];
num++;
}
else{
s += x[0];
num++;
}
}
return s;
}
// int main() {
// return 0;
// }
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |