Submission #199004

#TimeUsernameProblemLanguageResultExecution timeMemory
199004kostia244Unscrambling a Messy Bug (IOI16_messy)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "messy.h" std::vector<int> restore_permutation(int n, int w, int r) { string t, s; for(int i = 0; i < n; i++) t += "0"; for(int i = 0; i < n; i++) { t[i] = '1'; add_element(t); } compile_set(); std::vector<int> ans(n, -1); for(int i = 0; i < n; i++) { for(int j = 0; j < n; j++) { if(ans[j]!=-1) continue; s[j] = '1'; if(check_element(s)) { ans[j] = i; break; } s[j] = '0'; } } return ans; }

Compilation message (stderr)

messy.cpp: In function 'std::vector<int> restore_permutation(int, int, int)':
messy.cpp:5:5: error: 'string' was not declared in this scope
     string t, s;
     ^~~~~~
messy.cpp:5:5: note: suggested alternatives:
In file included from /usr/include/c++/7/iosfwd:39:0,
                 from /usr/include/c++/7/ios:38,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/c++/7/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from messy.cpp:1:
/usr/include/c++/7/bits/stringfwd.h:74:33: note:   'std::__cxx11::string'
   typedef basic_string<char>    string;
                                 ^~~~~~
/usr/include/c++/7/bits/stringfwd.h:74:33: note:   'std::__cxx11::string'
messy.cpp:6:32: error: 't' was not declared in this scope
     for(int i = 0; i < n; i++) t += "0";
                                ^
messy.cpp:8:3: error: 't' was not declared in this scope
   t[i] = '1';
   ^
messy.cpp:16:4: error: 's' was not declared in this scope
    s[j] = '1';
    ^