Submission #1200447

#TimeUsernameProblemLanguageResultExecution timeMemory
1200447tamzidCombo (IOI18_combo)C++20
Compilation error
0 ms0 KiB
#include "combo.h" using namespace std; int best = 0; string ans; vector<char> ch{'A','B','X','Y'}; void backtrack(string p,int n,int i) { if(p.size() == 4 * n + 1) { return; } else { int a = press(p); if(a > best) { ans = p; best = a; } for(int j=0;j<4;++j) { if(i != j) { backtrack(p + ch[i], n, i); } } } } string guess_sequence(int N) { string p = ""; vector<bool> vis(4,0); for(int i=0;i<4;++i) { p[0] = ch[i]; backtrack(p,N,i); } return ans; }

Compilation message (stderr)

combo.cpp:6:1: error: 'vector' does not name a type
    6 | vector<char> ch{'A','B','X','Y'};
      | ^~~~~~
combo.cpp: In function 'void backtrack(std::string, int, int)':
combo.cpp:26:29: error: 'ch' was not declared in this scope
   26 |               backtrack(p + ch[i], n, i);
      |                             ^~
combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:34:3: error: 'vector' was not declared in this scope
   34 |   vector<bool> vis(4,0);
      |   ^~~~~~
combo.cpp:2:1: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
    1 | #include "combo.h"
  +++ |+#include <vector>
    2 | using namespace std;
combo.cpp:34:10: error: expected primary-expression before 'bool'
   34 |   vector<bool> vis(4,0);
      |          ^~~~
combo.cpp:37:14: error: 'ch' was not declared in this scope
   37 |       p[0] = ch[i];
      |              ^~