제출 #849926

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

std::string guess_sequence(int N) {
    string pref="";
    char P[4]={'A','B','C','D'};
    for(int i=0;i<n;i++){
        for(int j=0;j<4;j++){
            if(press(pref+P[j])==i+1){
                pref+=P[j];
                break;
            }
        }
    }
    return pref;
}
/*
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin>>n;
    char P[4]={'A','B','X','Y'};
    if(n==3){
        for(int i=0;i<n;i++){
            for(int j=0;j<4;j++){
                if(press(pref+P[j])==i+1){
                    pref+=P[j];
                    break;
                }
            }
        }
        guess_sequence(n);
    }
}*/

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:9:19: error: 'n' was not declared in this scope
    9 |     for(int i=0;i<n;i++){
      |                   ^