Submission #220020

#TimeUsernameProblemLanguageResultExecution timeMemory
220020UserIsUndefinedCombo (IOI18_combo)C++14
0 / 100
1 ms200 KiB
/**
 *    author:  Mohamad Milhem
 *    created: 2020-04-06-22.53.40
**/

#include <bits/stdc++.h>
#include <stdio.h>
#include "combo.h"

using namespace std;
typedef long long ll;

#define FAST ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define mp make_pair
#define pb push_back
#define lp(i,s,f) for(ll i = s; i < ll(f); i++)
#define inF freopen("input.in", "r", stdin);
#define outF freopen("output.in", "w", stdout);
#define MOD ll(1000000007)
#define debug(x) cout << '[' << #x << " is: " << x << "] " <<endl;
#define decimalpoint cout << std::fixed << setprecision(5)






std::string guess_sequence(int N) {
    string First = "ABXY";
    int indx = -1;

    for (int i = 0 ; i < 3 ; i++){
        string here = "";
        here+=First[i];
        if (press(here) > 0){indx = i ; break;}
    }
    if (indx == -1)indx = 3;

    vector<char> rest;
    for (int i = 0 ; i < 4 ; i++){
        if (i != indx)rest.push_back(First[i]);
    }

    string now = "" ;
    now+=First[indx];


    for (int i = 0 ; i < N - 1; i++){
        string q = "";
        string first = now + rest[1];
        string second1 = now + rest[2] + rest[0] + now + rest[2] + rest[1] + now + rest[2] + rest[2];
        q+=first;
        q+=second1;
        int ans = press(q);
        int in = ans-now.size();
        now+= rest[in];
    }


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