제출 #85512

#제출 시각아이디문제언어결과실행 시간메모리
85512JustasLeCombo (IOI18_combo)C++17
컴파일 에러
0 ms0 KiB
/*input
9
1 2 3 7 6 5 5 2 6
*/
#include <bits/stdc++.h>

using namespace std;

string guess_sequence(int N) {
	string ans = "";
	string poss = "ABXY";
	for (int i = 0; i < 4; i++) {
		string temp = "" + poss[i];
		int cnt = press(temp);
		if (cnt > 0) {
			poss.erase(poss.begin() + i);
			ans += temp;
			break;
		}
	}
	bool ok = true;
	int prev = 1;
	while (ok) {
		ok = false;
		for (int i = 0; i < 3; i++) {
			string newAns = ans + "" + poss[i];
			int cnt = press(newAns);
			if(cnt > prev) {
				ans = newAns;
				ok = true;
				prev = cnt;
				break;
			}
		}
	}
	return ans;
}

int main() {

	return 0;
}

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:14:13: error: 'press' was not declared in this scope
   14 |   int cnt = press(temp);
      |             ^~~~~
combo.cpp:27:14: error: 'press' was not declared in this scope
   27 |    int cnt = press(newAns);
      |              ^~~~~