Submission #500052

#TimeUsernameProblemLanguageResultExecution timeMemory
500052LucaIlieCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include <iostream> #include "combo.h" using namespace std; string guess_sequence( int n ) { int i; string ans; for ( i = 1; i <= n; i++ ) { if ( (i > 1 && ch[0] != 'A') && press( ans + 'A' ) == i ) ans += 'A'; else if ( (i > 1 && ch[1] != 'B') && press( ans + 'B' ) == i ) ans += 'B'; else if ( (i > 1 && ch[2] != 'X') && press( ans + 'X' ) == i ) ans += 'X'; else ans += 'Y'; } return ans; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:12:24: error: 'ch' was not declared in this scope
   12 |         if ( (i > 1 && ch[0] != 'A') && press( ans + 'A' ) == i )
      |                        ^~