prog.cpp: In function 'void solve(std::string&, int)':
prog.cpp:13:23: error: invalid initialization of non-const reference of type 'std::string& {aka std::basic_string<char>&}' from an rvalue of type 'std::basic_string<char>'
solve(s.substr(0, n - 1), n - 1);
^
prog.cpp:9:6: note: initializing argument 1 of 'void solve(std::string&, int)'
void solve(string &s, int n)
^
prog.cpp: In function 'int main()':
prog.cpp:21:28: error: invalid initialization of non-const reference of type 'std::string& {aka std::basic_string<char>&}' from an rvalue of type 'std::string {aka std::basic_string<char>}'
solve(string(n, '#'), n);
^
prog.cpp:9:6: note: initializing argument 1 of 'void solve(std::string&, int)'
void solve(string &s, int n)
^