Submission #93046

#TimeUsernameProblemLanguageResultExecution timeMemory
93046temoyanteladzeCombo (IOI18_combo)C++14
30 / 100
67 ms440 KiB
#include<bits/stdc++.h>
#include "combo.h"
using namespace std;

string guess_sequence(int n)
{
    string s="";
    string ch="";
        if (press("A"))
    {
        s+="A";
        ch="A";

    }
        if (press("B"))
         {
          s+="B";
          ch="B";
          }

         if (press("X"))
         {

            s+="X";
            ch="X";
         }
        if (s.size()!=1)
        {
              s+="Y";
              ch="Y";
        }
        string t="ABXY";
        int k=t.find(ch);
        t.erase(t.begin()+k);

     for (int i=2;i<=n;i++)
     {
        for (int k=0;k<3;k++)
        {
            if (k==2)
            {
                s+=t[k];
                break;
            }
            if (press(s+t[k])==i )
            {
                s+=t[k];
                break;
            }

        }

     }

        return s;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...