# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
133410 | reda | Combo (IOI18_combo) | C++14 | 68 ms | 256 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"
using namespace std ;
string guess_sequence(int N)
{
if(N==3)
{
string ans="";
string use[4]={"A","B","X","Y"};
int g=-1;
string t;
for(int i=0;i<4;i++)
{
if(press(use[i])>g)
{
g=press(use[i]);
t=use[i];
}
}
ans+=t;
string s;
if(t=="A")s="BXY";
if(t=="B")s="AXY";
if(t=="X")s="ABY";
if(t=="Y")s="ABX";
int i=0;
int pv=press(ans);
while (ans.size()<3)
{
string C;
C=ans;
C+=s[i];
int k =press(C);
if(k>pv)
{
ans+=s[i];
pv=k;
}
else i++;
i=i%3;
}
return ans;
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |