Submission #500060

#TimeUsernameProblemLanguageResultExecution timeMemory
500060LucaIlieCombo (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 || ans[0] != 'A') && press( ans + 'A' ) == i ) ans += 'A'; else if ( (i == 1 || ans[0]] != 'B') && press( ans + 'B' ) == i ) ans += 'B'; else if ( (i == 1 || ans[0] != 'X') && press( ans + 'X' ) == i ) ans += 'X'; else ans += 'Y'; } return ans; } int main() { cout << "Hello world!" << endl; return 0; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:14:36: error: expected ')' before ']' token
   14 |         else if ( (i == 1 || ans[0]] != 'B') && press( ans + 'B' ) == i )
      |                   ~                ^
      |                                    )
combo.cpp:15:23: error: expected ')' before ';' token
   15 |             ans += 'B';
      |                       ^
      |                       )
combo.cpp:14:17: note: to match this '('
   14 |         else if ( (i == 1 || ans[0]] != 'B') && press( ans + 'B' ) == i )
      |                 ^