Submission #586129

#TimeUsernameProblemLanguageResultExecution timeMemory
586129tamthegodUnscrambling a Messy Bug (IOI16_messy)C++14
Compilation error
0 ms0 KiB
#include <vector> #include "messy.h" std::vector<int> restore_permutation(int n, int w, int r) { string s; for(int i=1; i<=n; i++) s += '0'; for(int i=1; i<=n; i++) { s[i - 1] = '1'; add_element(s); } add_element("0"); compile_set(); check_element("0"); return std::vector<int>(); }

Compilation message (stderr)

messy.cpp: In function 'std::vector<int> restore_permutation(int, int, int)':
messy.cpp:6:5: error: 'string' was not declared in this scope; did you mean 'std::string'?
    6 |     string s;
      |     ^~~~~~
      |     std::string
In file included from /usr/include/c++/10/string:39,
                 from messy.h:4,
                 from messy.cpp:3:
/usr/include/c++/10/bits/stringfwd.h:79:33: note: 'std::string' declared here
   79 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
messy.cpp:7:29: error: 's' was not declared in this scope
    7 |     for(int i=1; i<=n; i++) s += '0';
      |                             ^
messy.cpp:10:9: error: 's' was not declared in this scope
   10 |         s[i - 1] = '1';
      |         ^