Submission #1318786

#TimeUsernameProblemLanguageResultExecution timeMemory
1318786tkm_algorithmsCombo (IOI18_combo)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include "combo.h"

using namespace std;
using ll = long long;
#define int ll
using P = pair<int, int>;
#define all(x) x.begin(), x.end()
#define rep(i, l, n) for (int i = l; i < (n); ++i)
#define sz(x) (int)x.size()
const char nl = '\n';

string guess_sequence(int n) {
	string p;
	int x = press("AB");
	if (x == 1) {
		if (press("A"))p += 'A';
		else p += 'B';
	} else {
		if (press("X"))p += 'X';
		else p += 'Y';
	}
	
	if (n == 1)return p;
	
	char a, b, c;
	if (p[0] == 'A')a = 'B', b = 'X', c = 'Y';
	else if (p[0] == 'B')a = 'A', b = 'X', c = 'Y';
	else if (p[0] == 'X')a = 'A', b = 'B', c = 'Y';
	else a = 'A', b = 'B', c = 'X';
	
	rep(i, 2, n) {
		x = press(p+a+p+b+a+p+b+c+p+b+b);
		if (x == i)p += a;
		else if (x == i+1)p += b;
		else p += c;
	}
	
	x = press(p+a+p+b);
	if (x == n) {
		if (press(p+a) == n)return p+a;
		else return p+b;
	} else return p+c;
}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccGyPHSO.o: in function `main':
grader.cpp:(.text.startup+0x4b): undefined reference to `guess_sequence[abi:cxx11](int)'
collect2: error: ld returned 1 exit status