Submission #670809

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
6708092022-12-10 16:18:43mdubCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
string guess_sequence(int n) {
string first;
string prefix, second;
string th1, th2, th3;
string other;
if (press("A")) {
prefix = "A";
second = "B";
th1 = "XB";
th2= "XX";
th3 = "XY";
other = "Y";
}
else if (press("B")) {
prefix = "B";
second = "A";
th1 = "XA";
th2 = "XX";
th3 = "XY";
other = "Y";
}
else if (press("X")) {
prefix = "X";
second = "A";
th1 = "BB";
th2 = "BA";
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:10:7: error: 'press' was not declared in this scope
   10 |   if (press("A")) {
      |       ^~~~~
combo.cpp:42:7: error: 'N' was not declared in this scope
   42 |   if (N == 1) return prefix;
      |       ^
combo.cpp:43:23: error: 'N' was not declared in this scope
   43 |   for (int i = 1; i < N - 1; i++) {
      |                       ^
combo.cpp:44:16: error: 'press' was not declared in this scope
   44 |     int temp = press(prefix + second + prefix + th1 + prefix + th2 + prefix + th3);
      |                ^~~~~
combo.cpp:45:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   45 |     if (temp == prefix.size()) prefix += other;
      |         ~~~~~^~~~~~~~~~~~~~~~
combo.cpp:46:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   46 |     else if (temp == prefix.size() + 1) prefix += second;
      |              ~~~~~^~~~~~~~~~~~~~~~~~~~
combo.cpp:47:20: error: 'th' was not declared in this scope; did you mean 'th3'?
   47 |     else prefix += th[0];
      |                    ^~
      |                    th3
combo.cpp:49:7: error: 'press' was not declared in this scope
   49 |   if (press(prefix+ second) == N) return prefix + second;
      |       ^~~~~
combo.cpp:49:32: error: 'N' was not declared in this scope
   49 |   if (press(prefix+ second) == N) return prefix + second;
      |                                ^