# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
890723 | kokoue | Combo (IOI18_combo) | C++14 | 0 ms | 344 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";}
}
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);
if(coins==1+i) S+=let[0];
if(coins==3+i) S+=let[1];
if(coins==0+i) S+=let[2];
}
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];
}
return S;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |