Submission #232226

#TimeUsernameProblemLanguageResultExecution timeMemory
232226pere_gilCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include <iostream> #include "combo.h" using namespace std; string guess_sequence(int N){ string s=""; string re=""; if(press("A")==1){ s="A"; re="BXY"; } else{ if(press("B")==1){ s="B"; re="AXY"; } else{ if(press("X")==1){ s="X"; re="ABY"; } else{ s="Y"; re="ABX"; } } bool ja; for(int i=0;i<N;i++){ ja=true; if(ja and press(s+re[0])>0){ s+=re[0]; ja=false; } if(ja and press(s+re[1])>0){ s+=re[1]; ja=false; } if(ja and press(s+re[2])>0){ s+=re[2]; ja=false; } } return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:46:1: error: expected '}' at end of input
   46 | }
      | ^
combo.cpp:6:29: note: to match this '{'
    6 | string guess_sequence(int N){
      |                             ^
combo.cpp:8:15: warning: control reaches end of non-void function [-Wreturn-type]
    8 |     string re="";
      |               ^~