Submission #652712

#TimeUsernameProblemLanguageResultExecution timeMemory
652712_HDHCombo (IOI18_combo)C++11
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #ifdef LOCAL #include <debug.h> #include "grader.cpp" #else #define debug(...) 1001 #endif using namespace std; #define all(x) x.begin(), x.end() #define st first #define nd second #define lb lower_bound #define ub upper_bound #define sz(x) (int)x.size() #define pb push_back #define pob pop_back #define pf push_front #define pof pop_front #define file "TEMPLATE" typedef long long ll; typedef pair<int, int> ii; typedef array<int, 3> iii; typedef vector<int> vi; typedef vector<ll> vl; string z = "ABXY"; string guess_sequence(int n){ string p; for (int i = 0; i < n; i++){ for (auto x: z){ if (press(p + z) == i + 1){ p.pb(z); break; } } } return p; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:35:8: error: 'press' was not declared in this scope
   35 |    if (press(p + z) == i + 1){
      |        ^~~~~
combo.cpp:36:10: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'char'
   36 |     p.pb(z);
      |          ^
      |          |
      |          std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/10/string:55,
                 from /usr/include/c++/10/bits/locale_classes.h:40,
                 from /usr/include/c++/10/bits/ios_base.h:41,
                 from /usr/include/c++/10/ios:42,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from combo.cpp:1:
/usr/include/c++/10/bits/basic_string.h:1320:24: note:   initializing argument 1 of 'void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::push_back(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
 1320 |       push_back(_CharT __c)
      |                 ~~~~~~~^~~
combo.cpp:34:13: warning: unused variable 'x' [-Wunused-variable]
   34 |   for (auto x: z){
      |             ^