제출 #341624

#제출 시각아이디문제언어결과실행 시간메모리
341624BlancaHM콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include "combo.h" string guess_sequence(int N) { string S; char first; int x = press("AB"); if (x == 2) { S = "AB"; first = 'A'; } else if (x == 1) { x = press("A"); if (x) { first = 'A'; S = "A"; } else { first = 'B'; S = "B"; } } else { x = press("X"); if (x) { first = 'X'; S = "X"; } else { first = 'Y'; S = "Y"; } } vector<string> pos; if (first != 'A') pos.push_back("A"); if (first != 'B') pos.push_back("B"); if (first != 'X') pos.push_back("X"); if (first != 'Y') pos.push_back("Y"); while((int) S.length() < N) { if (3*((int) S.length() + 2) + (int) S.length() + 1 <= 4*N) { x = press(S + pos[0] + pos[0] + S + pos[0] + pos[1] + S + pos[0] + pos[2] + S + pos[1]); if (x == (int) S.length() + 2) S += pos[0]; else if (x == (int) S.length() + 1) S += pos[1]; else S += pos[2]; } else { x = press(S + pos[0]); if(x == (int) S.length() + 1) { S += pos[0]; continue; } x = press(S + pos[1]); if (x == (int) S.length() + 1) S += pos[1]; else S += pos[2]; } } return S; }

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

combo.cpp:3:1: error: 'string' does not name a type; did you mean 'stdin'?
    3 | string guess_sequence(int N) {
      | ^~~~~~
      | stdin