Submission #281604

#TimeUsernameProblemLanguageResultExecution timeMemory
281604MrDominoCombo (IOI18_combo)C++14
10 / 100
94 ms564 KiB
#include <bits/stdc++.h>
#include "combo.h"

using namespace std;

string guess_sequence(int n) {
  string sol;
  string posi = "ABXY";
  while ((int) sol.size() < n) {
    bool found = 0;
    for (int j = 0; j < 4; j++) {
      if (press(sol + posi[j]) == (int) sol.size() + 1) {
        found = 1;
        sol += posi[j];
        break;
      }
    }
  }
  return sol;
}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:10:10: warning: variable 'found' set but not used [-Wunused-but-set-variable]
   10 |     bool found = 0;
      |          ^~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...