# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
707551 | firewater | Combo (IOI18_combo) | C++14 | 0 ms | 0 KiB |
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<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include "combo.h"
#define ll long long
using namespace std;
string str,p;
char a[10];
int x,w;
int main()
{
if(x=1){
}
}
std::string guess_sequence(int N) {
if(press("AB")){
if(press("A"))str="A";
else str="B";
}
else{
if(press("X"))str="X";
else str="Y";
}
if(str[0]!='A')a[++w]='A';
if(str[0]!='B')a[++w]='B';
if(str[0]!='X')a[++w]='X';
if(str[0]!='Y')a[++w]='Y';
for(int i=2;i<N;++i){
p=str+a[1]+a[1]+str+a[1]+a[2]+str+a[1]+a[3]+str+a[2];
x=press(p);
if(x==str.size()+2)str+=a[1];
else if(x==str.size()+1)str+=a[2];
else str+=a[3];
}
if(press(str+a[1])==n)str+=a[1];
else if(press(str+a[2])==n)str+=a[2];
else str+=a[3];
return str;
}