제출 #1345309

#제출 시각아이디문제언어결과실행 시간메모리
1345309nanaseyuzuki콤보 (IOI18_combo)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define pii pair<int, int>
#define all(a) a.begin(), a.end()
using namespace std;

#ifdef LOCAL
#include "C:\Users\Dell\Downloads\template\template\icpc-notebook\Utilities\debug.h"
#else
#define debug(...) 42
#endif

const int mn = 5e5 + 5, mod = 1e9 + 7, inf = 2e9;

string s; 

string guess_sequence(int n) {
	int num = press("AB");
	char ban;
	if(press >= 1) {
		if(press("A") == 1) ban = 'A';
		else ban = 'B';
	}
	else {
		if(press("X") == 1) ban = 'X';
		else ban = 'Y';
	}
	s += ban;

	vector <char> all = {'A', 'B', 'X', 'Y'};
	all.erase(all.find(ban));

	for(int i = 1; i < n; i ++) {
		for(int i = 0; i < 2; i++) {
			if(press(s + all[i]) == i + 1) s += all[i];	
		}
		if(s.size() == i) s += all[2];
	}
	return s;
}
// Don't wanna lose anymore T_T
// Never let me go - Kazuo Ishiguro

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:20:19: error: 'press' was not declared in this scope
   20 |         int num = press("AB");
      |                   ^~~~~
combo.cpp:33:23: error: 'class std::vector<char>' has no member named 'find'
   33 |         all.erase(all.find(ban));
      |                       ^~~~