제출 #140714

#제출 시각아이디문제언어결과실행 시간메모리
140714astoria콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
string guess_sequence(int N){ string solved_string; int xy = press("XY"); if (xy>=1){ if (press("X") == 1){ solved_string = "X"; } else solved_string = "Y"; } else{ if (press("A") == 1){ solved_string = "A"; } else solved_string = "B"; } string valids[3]; if (solved_string=="A"){ valids[0] = "B"; valids[1] = "X"; valids[2] = "Y";} if (solved_string=="B"){ valids[0] = "A"; valids[1] = "X"; valids[2] = "Y";} if (solved_string=="X"){ valids[0] = "A"; valids[1] = "B"; valids[2] = "Y";} if (solved_string=="Y"){ valids[0] = "A"; valids[1] = "B"; valids[2] = "X";} for (int i=1; i<N-1; i++){ string newnew = solved_string + valids[0] + solved_string + valids[1] + valids[0] + solved_string + valids[1] + valids[1] + solved_string + valids[1] + valids[2]; int p = press(newnew); if (p==i+2) solved_string+=valids[0]; else if (p==i+1) solved_string+=valids[1]; else solved_string+=valids[2]; } return solved_string+"X"; /*string hi = solved_string+valids[0]; string ih = solved_string+valids[1]; string ihhi = solved_string+valids[2]; if (press(hi) == N) return hi; if (press(ih) == N) return ih; else return ihhi;*/ //return "Hi"; }

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

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