# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1064730 | vjudge1 | 콤보 (IOI18_combo) | C++17 | 1 ms | 428 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;
string guess_sequence(int n) {
string str="",ans="";
str+="AB";
int x=press(str);
if(x>=1)
{
if(press("A"))
ans+="A";
else
ans+="B";
}
else
{
if(press("X"))
ans+="X";
else
ans+="Y";
}
str="";
if(ans=="X")
str="ABY";
else if(ans=="Y")
str="ABX";
else if(ans=="A")
str="BXY";
else
str="AXY";
for(int i=2;i<=(n-2);i++)
{
string now=ans+str[0]+str[1]+ans+str[0]+str[0]+ans+str[0]+str[2]+ans+str[1];
int temp=press(now);
if(temp==ans.length())
{
ans+=str[2];
}
else if(temp==ans.length()+1)
{
ans+=str[1];
}
else
ans+=str[0];
//cout<<ans<<endl;
}
if(press(ans+str[0])==n-1)
ans+=str[0];
else if(press(ans+str[1])==n-1)
ans+=str[1];
else
ans+=str[2];
if(press(ans+str[0])==n)
ans+=str[0];
else if(press(ans+str[1])==n)
ans+=str[1];
else
ans+=str[2];
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |