| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 1191860 | p4r4d0_x | 콤보 (IOI18_combo) | C++20 | 0 ms | 0 KiB | 
#include "combo.h"
#include<bits/stdc++.h>
using namespace std;
string guess_sequence(int N) {
  vector<char> a = {'A', 'B', 'X', 'Y'};
  string s = "";
  for(int i = 0; i < 4; ++i){
      s += a[i];
      if(press(s) == 1){
          break;
      }
      else s = "";
  }
  vector<char> b;
  for(int i = 0; i < 4; ++i){
      if(a[i] != s[0]){
          b.pb(a[i]);
      }
  }
  vector<string> vs;
  sort(begin(b), end(b));
  do{
      string st = "";
      for(int i = 0; i < 3; ++i){
          st += b[i];
      }
      vs.pb(st);
  }
  while(next_permutation(begin(b), end(b)));
  ll cnt = 1;
  while(cnt != N){
      if(cnt + 3 <= N){
          for(auto &x : vs){
              if(press(s + x) == cnt + 3){
                  s += x;
                  cnt += 3;
                  break;
              }
          }
      }
      else{
          for(int i = 0; i < 4; ++i){
              if(press(s + a[i]) == cnt + 1){
                  s += a[i];
                  cnt++;
                  break;
              }
          }
      }
  }
  return s;
}
