제출 #130112

#제출 시각아이디문제언어결과실행 시간메모리
130112HungAnhGoldIBO2020콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include<iostream>
using namespace std;
char ohyeah={'X','Y','A','B'};
string guess_sequence(int N){
	string cac="";
	int i,j;
	for(i=0;i<N;i++){
		for(j=0;j<4;j++){
			if(i!=0&&cac[0]==ohyeah[j]){
				continue;
			}
			if(press(cac+ohyeah[j])==i+1){
				cac+=ohyeah[j];
				break;
			}
		}
	}
	return cac;
}

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

combo.cpp:3:6: error: scalar object 'ohyeah' requires one element in initializer
    3 | char ohyeah={'X','Y','A','B'};
      |      ^~~~~~
combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:12:7: error: 'press' was not declared in this scope
   12 |    if(press(cac+ohyeah[j])==i+1){
      |       ^~~~~