제출 #737777

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

string guess_sequence(int N) {
  string s;
  vector<char>v;
  if(press("A")==1){
    s+='A';
    v.push_back('B');
    v.push_back('Y');
    v.push_back('X');
  }
  else if(press("B")==1){
    s+='B';
    v.push_back('A');
    v.push_back('Y');
    v.push_back('X');
  }
  else if(press("X")==1){
      s+='X';
    v.push_back('B');
    v.push_back('Y');
    v.push_back('A');
  }
  else{
      s+='Y';
    v.push_back('B');
    v.push_back('A');
    v.push_back('X');
  }

  for(int i=1;i<n;i++){
    for(char i:v){
        if(press(s+i)==i+1){
            s+=i;
            break;
        }
    }
  }


  return S;
}

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:33:17: error: 'n' was not declared in this scope
   33 |   for(int i=1;i<n;i++){
      |                 ^
combo.cpp:43:10: error: 'S' was not declared in this scope
   43 |   return S;
      |          ^