제출 #862942

#제출 시각아이디문제언어결과실행 시간메모리
862942HataNoKokoro콤보 (IOI18_combo)C++17
컴파일 에러
0 ms0 KiB
string guess_sequence(int N) { string result = ""; int coin; ///ask first char coin = press("AB"); if(coin == 0) { c_list[0] = 'A'; c_list[1] = 'B'; result += (press("X") ? 'X' : 'Y'); c_list[2] = (result[0] == 'X' ? 'Y' : 'X'); } else { result += (press("A") ? 'A' : 'B'); c_list[0] = (result[0] == 'A' ? 'B' : 'A'); c_list[1] = 'X'; c_list[2] = 'Y'; } ///ask 2 -> n-1 char for(int i = 2; i < N; i++) { coin = press(result + c_list[0] + c_list[0] + result + c_list[0] + c_list[1] +result + c_list[0] + c_list[2] + result + c_list[1]); if(coin == i + 1) result += c_list[0]; else if(coin == i) result += c_list[1]; else result += c_list[2]; } ///ask n char coin = press(result + c_list[0] + result + c_list[1]); if(coin == N) return (press(result + c_list[0]) == N ? result + c_list[0] : result + c_list[1]); return result + c_list[2]; }

컴파일 시 표준 에러 (stderr) 메시지

combo.cpp:1:1: error: 'string' does not name a type
    1 | string guess_sequence(int N)
      | ^~~~~~