Submission #855678

#TimeUsernameProblemLanguageResultExecution timeMemory
855678IS_RushdiCombo (IOI18_combo)C++17
10 / 100
29 ms1448 KiB
#include "combo.h"
using namespace std;
typedef long long ll;

string guess_sequence(int N) {
  string p = "";
  string x = "ABXY";
  char z = 'A';
  for(int i = 0; i < 4; i++){
    p=x[i];
    int coin = press(p);
    if(coin == 1) z = x[i];
    p = "";
  }
  string S = ""; S+=z;
  for(int i = 2; i <= N; i++){
    for(int j = 0; j < 4; j++){
        if(x[j] == z) continue;
        p = S; p+=x[j];
        int coin = press(p);
        if(coin == i){
            S+=x[j];
            break;
        }
    }
  }
  return S;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...