Submission #524211

#TimeUsernameProblemLanguageResultExecution timeMemory
524211daisyCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include "combo.h" std::string guess_sequence(int N) { std::string curr,r; int t; if(press("AB")) { if(press("A") {curr="A";r="BXY";} else {curr="B";r="AXY";} } else if(press("X")) {curr="X";r="ABY";} else {curr="Y";r="AXB";} for(int i=2;i<N;i++) { t=press(curr+r[0]+r[0]+curr+r[0]+r[1]+curr+r[0]+r[2]+curr+r[1]); if(t==i) curr+=r[1]; else if(t==i+1) curr+=r[0]; else curr+=r[2]; } if(N>1){ if(press(curr+r[0])==N) curr+=r[0]; else if(press(curr+r[1])==N) curr+=r[1]; else curr+=r[2]; } return curr; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:9:22: error: expected ')' before '{' token
    9 |         if(press("A") {curr="A";r="BXY";}
      |           ~          ^~
      |                      )
combo.cpp:11:5: error: expected primary-expression before '}' token
   11 |     }
      |     ^