제출 #936001

#제출 시각아이디문제언어결과실행 시간메모리
936001VMaksimoski008Combo (IOI18_combo)C++14
컴파일 에러
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; }

컴파일 시 표준 에러 (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'}) {
      |                                           ^