#include "combo.h"
#include <bits/stdc++.h>
//#include"grader.cpp"
using namespace std;
std::string guess_sequence(int N) {
std::string p = "";
string s[4]={"A","B","X","Y"};
string first;
/*
for(int i=0;i<4;i++){
p=s[i];
int ok=press(p);
//cout<<ok;
if(ok==1){
first=s[i]; break;
}
}*/
int query=press("AB");
string ret;
if(query){
ret=press("A")?"A":"B";
}else{
ret=press("X")?"X":"Y";
}
first=ret;
int si=N;si--;
int now=2;
while(si){
int coun=0;
for(int i=0;i<4;i++){
if(s[i]==first){continue;}
if(coun<2){
int ok=press(ret+s[i]);
if(ok==now){
ret+=s[i];
now++;
break;
}else{coun++;}}else{
ret+=s[i];now--;
break;
}
}si--;
}cout<<ret;
return ret;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
200 KB |
DO NOT PRINT ANYTHING TO STANDARD OUTPUT |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
200 KB |
DO NOT PRINT ANYTHING TO STANDARD OUTPUT |
2 |
Halted |
0 ms |
0 KB |
- |