Submission #497230

#TimeUsernameProblemLanguageResultExecution timeMemory
497230pakhomoveeCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include "combo.h"
#include <vector>

using namespace std;

int press(string p)​;

vector<char> v = { 'A', 'B', 'X', 'Y' };

string guess_sequence(int N)​ {
	string res;
	for (int i = 0; i < 3; ++i) {
		string curr;
		curr += v[i];
		if (press(curr)) {
			res += v[i];
			break;
		}
	}
	v.erase(v.find(v.begin(), v.end(), res[0]));
	int ptr = 1;
	while (ptr + 1 < N) {
		string query = res;
		query += v[0];
		query += res;
		query += v[1];
		query += v[0];
		query += res;
		query += v[1];
		query += v[1];
		query += res;
		query += v[1];
		query += v[2];
		int c = press(query);
		if (c) {
			res += v[2];
		} else if (c == 1) {
			res += v[0];
		} else {
			res += v[1];
		}
	}
	if (ptr < N) {
		for (int i = 0; i < 3; ++i) {
			string curr = res;
			curr += v[i];
			if (press(curr) == N) {
				res += v[i];
				break;
			}
		}
	}
	return res;
}

Compilation message (stderr)

combo.cpp:6:20: error: expected initializer before '\U0000200b'
    6 | int press(string p)​;
      |                     
combo.cpp:10:29: error: expected initializer before '\U0000200b'
   10 | string guess_sequence(int N)​ {
      |