제출 #335254

#제출 시각아이디문제언어결과실행 시간메모리
335254fadi57Combo (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include "combo.h"
#include <bits/stdc++.h>

//#include"grader.cpp"
using namespace std;
std::string guess_sequence(int N) {
  std::string p = "";
string s[4]={"A","B","X","Y"};
string first;
for(int i=0;i<4;i++){
p=s[i];
int ok=press(p);
//cout<<ok;
if(ok==1){
   first=s[i]; break;
}
}
string ret=first;
 S=first;
//S=first;
//ret+="B";
//cout<<ret<<endl;

int si=N;si--;
int now=2;
while(si){
  for(int i=0;i<4;i++){
if(s[i]==first){continue;}
int ok=press(ret+s[i]);
if(ok==now){
    ret+=s[i];
        now++;
    break;
}
}si--;
}
  return ret;
}

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:19:2: error: 'S' was not declared in this scope
   19 |  S=first;
      |  ^