제출 #92966

#제출 시각아이디문제언어결과실행 시간메모리
92966beso123콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
#include "combo.h"
string a="ABXY";
using namespace std;

string guess_sequence(int N){
    string s;
for(int k=1;k<=n;k++)
if(press(a[k])==1){
s+=a[k];
break;
}
for(int k=1;k<=n;k++){
    string b=s+a[k];
if(press(b)==2){
s=b;
break;
}
}
for(int k=1;k<=n;k++){
    string b=s+a[k];
if(press(b)==3){
s=b;
break;
}
}
return s;
}

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

combo.cpp:3:1: error: 'string' does not name a type; did you mean 'stdin'?
    3 | string a="ABXY";
      | ^~~~~~
      | stdin
combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:8:16: error: 'n' was not declared in this scope
    8 | for(int k=1;k<=n;k++)
      |                ^
combo.cpp:9:10: error: 'a' was not declared in this scope
    9 | if(press(a[k])==1){
      |          ^
combo.cpp:13:16: error: 'n' was not declared in this scope
   13 | for(int k=1;k<=n;k++){
      |                ^
combo.cpp:14:16: error: 'a' was not declared in this scope
   14 |     string b=s+a[k];
      |                ^
combo.cpp:20:16: error: 'n' was not declared in this scope
   20 | for(int k=1;k<=n;k++){
      |                ^
combo.cpp:21:16: error: 'a' was not declared in this scope
   21 |     string b=s+a[k];
      |                ^