# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
861358 | imarn | 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<bits/stdc++.h>
//#include "insects.h"
#define f first
#define s second
#define pb push_back
#define pii pair<int,int>
#define ll long long
using namespace std;
int press(std::string p){
}
string guess_sequence(int N){
string ans;
string s[4];
if(press("A")==1)ans="A",s[0]="A",s[1]="B",s[2]="X",s[3]="Y";
else if(press("B")==1)ans="B",s[0]="B",s[1]="A",s[2]="X",s[3]="Y";
else if(press("X")==1)ans="X",s[0]="X",s[1]="B",s[2]="A",s[3]="Y";
else ans="Y",s[0]="Y",s[1]="B",s[2]="X",s[3]="A";
for(int i=2;i<=N;i++){
string now1 = ans+s[1];
string now2 = ans+s[2]+s[1];
string now3 = ans+s[2]+s[2];
string now4 = ans+s[2]+s[3];
string tt = now1+now2+now3+now4;
int x = press(tt);
if(x==i-1)ans = ans+s[3];
else if(x==i)ans = ans+s[1];
else ans = ans+s[2];
}return ans;
}