제출 #298617

#제출 시각아이디문제언어결과실행 시간메모리
298617AmineTrabelsi콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define v(x) vector<x>
#define pb push_back 
#define mp make_pair
const ll maxint=2e18;
const ll minint =-2e18;
/*
(͡ ° ͜ʖ ͡ °): Hi, be careful of overflow.
*/
/*
// comment out when submitting
int press(string p){
	cout<<p<<endl;
	int x;
	cin>>x;
	return x;
}*/
string let[4]={"A","B","X","Y"};
string guess_sequence(int N){
	string res ="";
	int cnt = 0;
	for(int i=0;i<N;i++){
		for(int j=0;j<4;j++){
			int x = press((res+let[j]));
			if(x == cnt+1){
				//cout<<x<<" "<<cnt<<" "<<j<<" "<<let[j]<<endl;
				res+=let[j];
				cnt++;
				break;
			}
		}
	}
	return res;	
}
// comment out when submitting
/*
int main(){
	int n;
	cin>>n;
	cout<<guess_sequence(n)<<'\n';
	return 0;
}
*/

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:26:12: error: 'press' was not declared in this scope; did you mean 'res'?
   26 |    int x = press((res+let[j]));
      |            ^~~~~
      |            res