Submission #549505

#TimeUsernameProblemLanguageResultExecution timeMemory
549505Clan328콤보 (IOI18_combo)C++17
10 / 100
101 ms456 KiB
#include "combo.h"
#include <bits/stdc++.h>

using namespace std;

string buttons = "ABXY";

string guess_sequence(int N) {
  string S = "";
  int curr = 0;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < 4; j++) {
      string p = S+buttons[j];
      while (p.size() < N) p += p[0];

      if (press(p) > curr) {
        curr++;
        S += buttons[j];
        break;
      }
    }
  }

  return S;
}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:14:23: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   14 |       while (p.size() < N) p += p[0];
      |              ~~~~~~~~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...