Submission #552289

#TimeUsernameProblemLanguageResultExecution timeMemory
552289ctphongCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std;
#define fto(i,a,b) for(int i = a; i <= b; ++i)
string s;

int press(string s) {
	cout << s << endl;
	fflush(stdout);
	int gt; cin >> gt;
	return gt;
}

string guess_sequence(int N) {
	int n; cin >> n;
	string gt = "";
	if (press(s+"X") == 1) s = s + "X";
	else if (press(s+"Y") == 1) s = s + "Y";
	else if (press(s+"A") == 1) s = s + "A";
	else if (press(s+"B") == 1) s = s + "B";
	gt = s;
	fto (i, 2, n) {
		if (press(s+"X"+gt) == i) s = s + "X";
		else if (press(s+"Y"+gt) == i) s = s + "Y";
		else if (press(s+"A"+gt) == i) s = s + "A";
		else if (press(s+"B"+gt) == i) s = s + "B";
	}
	return s;
}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccthhAr5.o: in function `press(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
grader.cpp:(.text+0x0): multiple definition of `press(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'; /tmp/cc2B9ti5.o:combo.cpp:(.text+0xc0): first defined here
collect2: error: ld returned 1 exit status