Submission #763868

#TimeUsernameProblemLanguageResultExecution timeMemory
763868ind1vCombo (IOI18_combo)C++11
5 / 100
1 ms336 KiB
#include <bits/stdc++.h>
#include "combo.h"

using namespace std;

string guess_sequence(int n) {
  array<char, 4> c = {'A', 'B', 'X', 'Y'};
  vector<string> candidates;
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      for (int k = 0; k < 4; k++) {
        string s;
        s += c[i];
        s += c[j];
        s += c[k];
        candidates.emplace_back(s);
      }
    }
  }
  for (auto &x : candidates) {
    int ans = press(x);
    if (ans == 3) {
      return x;
    }
  }
}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:8:18: warning: control reaches end of non-void function [-Wreturn-type]
    8 |   vector<string> candidates;
      |                  ^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...