제출 #232030

#제출 시각아이디문제언어결과실행 시간메모리
232030pere_gil콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include "combo.h"

string guess_sequence(int N){
    string s="";
    string re="";
    if(press("A")>0){
        s="A";
        re="BXY";
    }
    if(press("B")>0){
        s="B";
        re="AXY";
    }
    if(press("X")>0){
        s="X";
        re="ABY";
    }
    if(press("Y")>0){
        s="Y";
        re="ABX";
    }
    bool ja;
    for(int i=0;i<N;i++){
        ja=true;
        if(ja and press(s+re[0])>0){
            s+=re[0];
            ja=false;
        }
        if(ja and press(s+re[1])>0){
            s+=re[1];
            ja=false;
        }
        if(ja and press(s+re[2])>0){
            s+=re[2];
            ja=false;
        }
    }
  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