제출 #1185798

#제출 시각아이디문제언어결과실행 시간메모리
1185798Mamikonm1콤보 (IOI18_combo)C++20
컴파일 에러
0 ms0 KiB
#include<bits//stdc++.h>
#include "combo.h"
using namespace std;
string guess_sequence(int N) {
    string s,t="ABXY";
    vector<char>x;
    if(press("AB")){
        if(press("A"))s+='A';
        else s+='B';
    }
    else if(press("X"))s+='X';
    else s+='Y';
    for(char y:t){
        if(y!=s[0]){
            x.push_back(y);
        }
    }
    int cur;
    for(int i=2;i<=N;++i){
        if(i<n){
            cur=press(s+x[0]+s+x[1]+x[1]+s+x[1]+x[2]);
            if(cur==i+1)s+=x[0];
            else if(cur==i+2)s+=x[1];
            else s+=x[2];
        }
        else{
            if(press(s+x[0])==i)s+=x[0];
            else if(press(s+x[1])==i)s+=x[1];
            else s+=x[2];
        }
    }
    return s;
}

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:20:14: error: 'n' was not declared in this scope
   20 |         if(i<n){
      |              ^