# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
498098 | IOI_champion_in_1980 | Combo (IOI18_combo) | C++14 | 2 ms | 456 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>
using namespace std;
int press(std::string p);
string guess_sequence(int n) {
//int main() {
string s="ABXY";
string yok, p;
for (long long a=0; a<3; a++)
{
string k;
k=k+s[a];
if (press(k)==1)
{
p=p+s[a];
break;
}
else
{
yok=yok+s[a];
}
}
if (p.length()==0) p=p+s[3]; else yok=yok+s[3];
for (long long a=2; a<=n-1; a++)
{
string st=p+yok[0]+yok[0]+p+yok[0]+yok[1]+p+yok[0]+yok[2]+p+yok[1];
long long k=press(st);
if (k==2) p=p+yok[0];
else if (k==1) p=p+yok[1];
else p=p+yok[2];
}
for (long long a=0; a<yok.length(); a++)
{
string st=p;
st=st+yok[a];
if (press(st)==n)
{
return p;
// cout<<p<<endl;
// break;
}
}
// return p;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |