Submission #240658

#TimeUsernameProblemLanguageResultExecution timeMemory
240658dannber_BRCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string Btns[] = {"A","B","X","Y"}; string guess_sequence(int N) { string s = ""; string p = ""; int long_gues = 0; if(press(Btns[0]+Btns[1]) > 1) { if(press(Btns[0])) { s += Btns[0];p = Btns[1]; long_gues++; } else { s += Btns[1];p = Btns[0]; long_gues++; } } else { if(press(Btns[2])) { s += Btns[2];p = Btns[3]; long_gues++; } else { s += Btns[3];p = Btns[2]; long_gues++; } } if (N == 1) { return s; } for(int i = long_gues + 1;i <= N;) { bool fact = false; if (press(s + p) == i) { s += p; fact = true; long_gues++; i++; } else if (fact == false) { if(press(s + Btns[0]+Btns[1]) > i) { if(press(s + Btns[0]) > i) { s += Btns[0];p = Btns[1]; long_gues++; i++; } else { s += Btns[1];p = Btns[0]; long_gues++; i++; } } else { if(press(s + Btns[2]) > i) { s += Btns[2];p = Btns[3]; long_gues++;i++; } else { s += Btns[3];p = Btns[2]; long_gues++;i++; } } } return s; }

Compilation message (stderr)

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