Submission #1317874

#TimeUsernameProblemLanguageResultExecution timeMemory
1317874ninstroyerCombo (IOI18_combo)C++20
0 / 100
0 ms332 KiB
#include "combo.h"
#include<bits/stdc++.h>
using namespace std;
//A,B,X,Y
vector<string> choices = {"A","B","X","Y"};
string guess_sequence(int n) 
{
    string p = "";
    char first;
    if(press("A")) p += "A";
    else if(press("B")) p += "B";
    else if(press("X")) p += "X";
    else p += "Y";
    first = p[0];
    int cur = 1;
    for(int i = 2; i <= n; i++)
    {
        for(auto c : choices)
        {
            if(c[0]==p[0]) continue;
            else if(press(c) > cur)
            {
               p += c;
               cur++;
               break;
            }
        }
    }
    return p;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...