Submission #348542

#TimeUsernameProblemLanguageResultExecution timeMemory
348542HalogenCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
std::string guess_sequence(int N) {
	char lst[4] = {'A', 'B', 'X', 'Y'};
  std::string p = "";
  int first = 4;

	for (int j = 0; j < N; j++) {
    if (press(p + lst[0] + p + lst[1]) >= p.size() + 1) {
        if (press(p + lst[0]) == p.size() + 1) p += lst[0];
        else p += lst[1];
    }
    else if (press(p + lst[2]) == p.size() + 1) p += lst[2];
    else p += lst[3];
	}

	return p;
}

Compilation message (stderr)

combo.cpp:1:6: error: 'string' in namespace 'std' does not name a type
    1 | std::string guess_sequence(int N) {
      |      ^~~~~~
combo.cpp:1:1: note: 'std::string' is defined in header '<string>'; did you forget to '#include <string>'?
  +++ |+#include <string>
    1 | std::string guess_sequence(int N) {