제출 #469915

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

string guess_sequence(int n){
  string ans="", s="", x;
  x="A";
  int nilai=press(x);
  if(nilai==1){
    ans=x;  
  }  
  x="B"
  nilai=press(x);
  if(nilai==1) ans=x;
  x="X";
  nilai=press(x);
  if(nilai==1) ans=x;
  x="Y";
  if(ans=="") ans=x;
  for(int i=1;i<n;++i){
    string tmp=ans;
    tmp+="X";
    nilai=press(x);
    if(nilai==(i+1)){
      ans=tmp;
      continue;
    }
    tmp=ans;
    tmp+="Y";
    nilai=press(x);
    if(nilai==(i+1)){
      ans=tmp;
      continue;
    }

    tmp=ans;
    tmp+="A";
    nilai=press(x);
    if(nilai==(i+1)){
      ans=tmp;
      continue;
    }

    tmp=ans;
    tmp+="B";
    ans=tmp;
    continue;
  }
  return ans;
}

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:12:8: error: expected ';' before 'nilai'
   12 |   x="B"
      |        ^
      |        ;
   13 |   nilai=press(x);
      |   ~~~~~