Submission #78856

#TimeUsernameProblemLanguageResultExecution timeMemory
78856renatsjCombo (IOI18_combo)C++14
30 / 100
69 ms456 KiB
#include<bits/stdc++.h>
#include "combo.h"
using namespace std;
int i,j,n,m;
string s,x;
char a[4];
std::string guess_sequence(int N)
{
    n=N;
    x="";
    if (press("A")==1)
    {
        a[0]='B';
        a[1]='X';
        a[2]='Y';
        x="A";
    }
    else if (press("B")==1)
    {
        a[0]='A';
        a[1]='X';
        a[2]='Y';
        x="B";
    }
    else if (press("X")==1)
    {
        a[0]='B';
        a[1]='A';
        a[2]='Y';
        x="X";
    }
    else
    {
        a[0]='B';
        a[1]='X';
        a[2]='A';
        x="Y";
    }
    i=1;
    while (i<n)
    {
        if (press(x+a[0])>i)
        {
            x+=a[0];
        }
        else if (press(x+a[1])>i)
        {
            x+=a[1];
        }
        else
        {
            x+=a[2];
        }
        i++;
    }
    return x;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...