Submission #1132239

#TimeUsernameProblemLanguageResultExecution timeMemory
1132239AMel0nCombo (IOI18_combo)C++20
Compilation error
0 ms0 KiB
#include "combo.h"
#include <bits/stdc++.h>
using namespace std;

std::string guess_sequence(int N) {
  string f;
  if (press("AB") >= 1) {
    if(press("B")) f = "B";
    else f = "A";
  } else {
    if press("X") f = "X";
    else f = "Y";
  }
  for(int i = 0; i < 4; i++) {
    string one;
    if (i == 0) one = "A";
    else if (i == 1) one = "B";
    else if (i == 2) one = "X";
    else one = "Y";
    string two;
    for(int j = 0; j < 4; j++) {
      if (j == 0) two = "A";
      else if (j == 1) two = "B";
      else if (j == 2) two = "X";
      else two = "Y";
      if (press(f + one + two) == 3) return f+one+two;
    }
  }
  return f+one+two;
}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:11:8: error: expected '(' before 'press'
   11 |     if press("X") f = "X";
      |        ^~~~~
      |        (
combo.cpp:12:5: error: 'else' without a previous 'if'
   12 |     else f = "Y";
      |     ^~~~
combo.cpp:29:12: error: 'one' was not declared in this scope
   29 |   return f+one+two;
      |            ^~~
combo.cpp:29:16: error: 'two' was not declared in this scope
   29 |   return f+one+two;
      |                ^~~