# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
592924 | daisy2 | Combo (IOI18_combo) | C++14 | 34 ms | 752 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<string>
#include<iostream>
using namespace std;
string r[6];
std::string guess_sequence(int N) {
char let[6]={0,'A','B','X','Y'},c[6];
int firstlet=0,in[6]={0,1,2,3,4};
string now="";
{ // first letter
if(press("AB")>=1)
{
if(press("A")==1)
{now=now+('A');}
else
{now=now+('B');swap(in[2],in[1]);}
}
else{
if(press("X")==1)
{now=now+('X');swap(in[3],in[1]);}
else {now=now+('Y');swap(in[4],in[1]);}
}
}
int re;
for (int i = 1; i < N-1; ++i) {
r[1]=now+let[in[2]]+let[in[2]];
r[2]=now+let[in[2]]+let[in[3]];
r[3]=now+let[in[2]]+let[in[4]];
r[4]=now+let[in[3]];
//cout<<r[1]<<endl;
r[1]=r[1]+r[2]+r[3]+r[4];
re=press(r[1]);
if(re==i+2)
now=now+let[in[2]];
else if(re==i+1)
now=now+let[in[3]];
else
now=now+let[in[4]];
}
//cout<<now<<endl;
if(N>1){
r[1]=now+let[in[2]];
r[2]=now+let[in[3]];
if(press(r[1]+r[2])==N)
{
if(press(r[1])==N) return r[1];
return r[2];
}
now=now+let[in[4]];}
return now;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |