Submission #552297

#TimeUsernameProblemLanguageResultExecution timeMemory
552297ctphongCombo (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 guess_sequence(int n) {
	string s;
	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)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:8:6: error: 'press' was not declared in this scope
    8 |  if (press(s+"X") == 1) s = s + "X";
      |      ^~~~~
combo.cpp:14:7: error: 'press' was not declared in this scope
   14 |   if (press(s+"X"+gt) == i) s = s + "X";
      |       ^~~~~