Submission #936001

#TimeUsernameProblemLanguageResultExecution timeMemory
936001VMaksimoski008콤보 (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include "combo.h"
#include <bits/stdc++.h>
using namespace std;

string guess_sequence(int N) {
    string S = "";

    for(int i=0; i<N; i++) {
        for(char &ch : {'A', 'B', 'X', 'Y'}) {
            S += ch;
            if(press(S) == i + 1) break;
        }
    }
  
    return S;
}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:9:43: error: binding reference of type 'char&' to 'const char' discards qualifiers
    9 |         for(char &ch : {'A', 'B', 'X', 'Y'}) {
      |                                           ^