Submission #583865

#TimeUsernameProblemLanguageResultExecution timeMemory
583865LIFCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include "combo.h" std::string guess_sequence(int N) { std::string p = ""; int n = N; char k[4] = {'A','B','X','Y'} for(int i=0;i<n;i++) { for(int j=0;j<4;j++) { std:: string ss = p; ss = ss + k[j]; if(press == i+1) { p = p + k[j]; break; } } } return p; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:7:3: error: expected ',' or ';' before 'for'
    7 |   for(int i=0;i<n;i++)
      |   ^~~
combo.cpp:7:15: error: 'i' was not declared in this scope
    7 |   for(int i=0;i<n;i++)
      |               ^
combo.cpp:6:8: warning: unused variable 'k' [-Wunused-variable]
    6 |   char k[4] = {'A','B','X','Y'}
      |        ^