Submission #1248079

#TimeUsernameProblemLanguageResultExecution timeMemory
1248079exoworldgdCombo (IOI18_combo)C++20
Compilation error
0 ms0 KiB
#pragma GCC optimize("O3")
#pragma GCC target("avx2,bmi,bmi2,popcnt,lzcnt")
#include <bits/stdc++.h>
#define exoworldgd cin.tie(0)->sync_with_stdio(0),cout.tie(0)
#define int long long
using namespace std;
int press(string s);
int ask(string s) {return press(s);}
string guess_sequence(int n) {
	string res= "";
	char c[4] = {'A','B','X','Y'},first;
    if (ask("A") > 0) first = 'A';
    else if (ask("B") > 0) first = 'B';
    else if (ask("X") > 0) first = 'X';
    else first = 'Y';
    res += first;
    vector<char> ch;
    for (char chr : c) if (chr != first) ch.push_back(chr);
    for (int i = 1; i< n; i ++) {
    	bool yes = 0;
    	for (int j =0 ; j < 2 && !yes; j++) {
    		string temp = res + ch[j];
    		if (ask(temp) == i+1) res += ch[j], yes = 1;
		}
		if (!yes) res += ch[2];
	}
	return res;
}

Compilation message (stderr)

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