# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
630199 | chubyxdxd | Combo (IOI18_combo) | C++11 | 1 ms | 256 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 "combo.h"
#include <bits/stdc++.h>
using namespace std;
std::string guess_sequence(int N) {
string S= "";
if(press("AB")){
if(press("A"))S+='A';
else S+='B';
}
else{
if(press("X"))S+='X';
else S+='Y';
}
string g="ABXY";
string aux;
for(int i=0;i<g.size();i++){
if(S[0]!=g[i])aux+=g[i];
}
//cout<<aux<<endl;
int ans=1;
for(int i=1;i<N-1;i++){
int pos=press(S+aux[0]+S+aux[1]+aux[1]+S+aux[1]+aux[2]+S+aux[1]+aux[0]);
if(pos==ans+1)S+=aux[0];
if(pos==ans)S+=aux[2];
if(pos==ans+2)S+=aux[1];
ans=S.size();
}
//cout<<S<<endl;
if(press(S+aux[0])>S.size())S+=aux[0];
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |