Submission #1006972

#TimeUsernameProblemLanguageResultExecution timeMemory
1006972kebineCombo (IOI18_combo)C++17
0 / 100
0 ms344 KiB
#include <bits/stdc++.h>
#include "combo.h"
using namespace std;

string guess_sequence(int n) {
  vector<char> c = {'A', 'B', 'X', 'Y'};

  string s;

  if (n == 1) {
    s = ".";
    for (auto &i : c) {
      s[0] = i;
      if (press(s)) {
        break;
      }
    }
  } else if (n == 2) {
    s = "..";
    for (auto &i : c) {
      for (auto &j : c) {
        s[0] = i;
        s[1] = j;
        if (press(s)) {
          goto done;
        }
      }
    }
  } else {
    s = "...";
    for (auto &i : c) {
      for (auto &j : c) {
        for (auto &k : c) {
          s[0] = i;
          s[1] = j;
          s[2] = k;
          if (press(s)) {
            goto done;
          }
        }
      }
    }
  }

  done:

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