| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 1142630 | rayankad | Combo (IOI18_combo) | C++20 | 1 ms | 432 KiB | 
#include "combo.h"
using namespace std;
string guess_sequence(int N) {
  string p = "AB";
  int coins = press(p);
  string P;
  string buttons = "BXY";
  if(coins >0){
    coins = press("A");
    if(coins == 1){
      P = "A"; 
    }
    else{
      buttons = "AXY";
      P = "B";
    }
  }
  else{
    coins = press("X");
    if(coins == 1){
      buttons = "ABY";
      P = "X";
    }
    else{
      buttons = "ABX";
      P = "Y";
    }
  }
  while(P.size() < N-1){
    int q = press(P+buttons[0] + P+buttons[1]+buttons[1] + P+buttons[1]+buttons[2] + P+buttons[1]+buttons[0]);
    if(q == P.size()){
      P+=buttons[2];
    }
    else if(q == P.size()+1){
      P+=buttons[0];
    }
    else{
      P+=buttons[1];
    }
  }
  for(int i = 0; i < 3; i++){
    int q = press(P+buttons[i]);
    if(q == P.size()+1){
      return P+buttons[i];
    }
  }
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
