miners.cpp:33:18: error: 'string_view' has not been declared
33 | int best(int off,string_view s,pair<i8,i8> h1={0,0}, pair<i8,i8> h2={0,0})
| ^~~~~~~~~~~
miners.cpp: In function 'int best(int, int, std::pair<signed char, signed char>, std::pair<signed char, signed char>)':
miners.cpp:35:17: error: request for member 'size' in 's', which is of non-class type 'int'
35 | if(off >= s.size()) return 0;
| ^~~~
miners.cpp:41:40: error: invalid types 'int[int]' for array subscript
41 | pair<i8,i8> h1p = {h1.second,toid(s[off])};
| ^
miners.cpp:41:46: error: could not convert '{h1.std::pair<signed char, signed char>::second, <expression error>}' from '<brace-enclosed initializer list>' to 'std::pair<signed char, signed char>'
41 | pair<i8,i8> h1p = {h1.second,toid(s[off])};
| ^
| |
| <brace-enclosed initializer list>
miners.cpp:42:68: error: invalid types 'int[int]' for array subscript
42 | max_produce = max(max_produce,produce(h1.first,h1.second,toid(s[off]))+best(off+1,s,h1p,h2));
| ^
miners.cpp:43:40: error: invalid types 'int[int]' for array subscript
43 | pair<i8,i8> h2p = {h2.second,toid(s[off])};
| ^
miners.cpp:43:46: error: could not convert '{h2.std::pair<signed char, signed char>::second, <expression error>}' from '<brace-enclosed initializer list>' to 'std::pair<signed char, signed char>'
43 | pair<i8,i8> h2p = {h2.second,toid(s[off])};
| ^
| |
| <brace-enclosed initializer list>
miners.cpp:44:68: error: invalid types 'int[int]' for array subscript
44 | max_produce = max(max_produce,produce(h2.first,h2.second,toid(s[off]))+best(off+1,s,h1,h2p));
| ^
miners.cpp: In function 'int main()':
miners.cpp:57:20: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int'
57 | cout << best(0,s) << "\n";
| ^
| |
| std::string {aka std::__cxx11::basic_string<char>}
miners.cpp:33:30: note: initializing argument 2 of 'int best(int, int, std::pair<signed char, signed char>, std::pair<signed char, signed char>)'
33 | int best(int off,string_view s,pair<i8,i8> h1={0,0}, pair<i8,i8> h2={0,0})
| ~~~~~~~~~~~~^