# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
890725 | kokoue | Combo (IOI18_combo) | C++14 | 1 ms | 500 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 "combo.h"
std::string guess_sequence(int N)
{
std::string p = "";
std::string S = "";
p="AX";
std::string let;
int bid;
int coins=press(p);
if(coins>=1)
{
p="A";
coins=press(p);
if(coins==1) {S+="A";let="XBY";}
else {S+="X";let="ABY";}
}
else
{
p="B";
coins=press(p);
if(coins==1) {S+="B";let="AXY";}
else {S+="Y";let="AXB";}
}
// std::cout<<"Current s = "<<S<<"\n";
for(int i=1;i<N-1;i++)
{
p="";
p=S+let[0];
p+=S+let[1]+let[0];
p+=S+let[1]+let[1];
p+=S+let[1]+let[2];
coins=press(p);
// std::cout<<"Press returned: "<<coins-i<<"\n";
if(coins==1+i) S+=let[0];
if(coins==2+i) S+=let[1];
if(coins==0+i) S+=let[2];
// std::cout<<"Current s = "<<S<<"\n";
}
p=S+let[0];
p+=S+let[1];
coins=press(p);
if(coins==0+N-1) S+=let[2];
else
{
p=S+let[0];
coins=press(p);
if(coins==0+N-1) S+=let[1];
if(coins==1+N-1) S+=let[0];
}
//std::cout<<"Current s = "<<S<<"\n";
return S;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |