Submission #1132232

#TimeUsernameProblemLanguageResultExecution timeMemory
1132232bobthescienceCombo (IOI18_combo)C++20
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include "combo.h" using namespace std; std::string guess_sequence(int N) { string p = ""; int r = 1, ord; vector<char> add = {'A', 'B', 'X', 'Y'}; for (int i = 0;i < 4;i++) { if (press("" + add[i])) { add.erase(add.begin() + i); break; } while (r < n) { for (char c :add) { if (press(p + c) > r) { r++; p += c; break } } } return p; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:15:14: error: 'n' was not declared in this scope
   15 |   while (r < n) {
      |              ^
combo.cpp:20:14: error: expected ';' before '}' token
   20 |         break
      |              ^
      |              ;
   21 |       }
      |       ~       
combo.cpp:25:2: error: expected '}' at end of input
   25 | }
      |  ^
combo.cpp:6:35: note: to match this '{'
    6 | std::string guess_sequence(int N) {
      |                                   ^
combo.cpp:25:2: warning: control reaches end of non-void function [-Wreturn-type]
   25 | }
      |  ^