Compile Error

/in/foo.cc: In function 'int hw(std::string&, int)':
/in/foo.cc:5:33: error: request for member 'begin' in 's4.std::__cxx11::basic_string<char>::operator[](1)', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
    5 |         string s3=reveres(s4[1].begin(),s4[1+j].end());
      |                                 ^~~~~
/in/foo.cc:5:49: error: request for member 'end' in 's4.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)(1 + j)))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
    5 |         string s3=reveres(s4[1].begin(),s4[1+j].end());
      |                                                 ^~~
/in/foo.cc:5:19: error: 'reveres' was not declared in this scope
    5 |         string s3=reveres(s4[1].begin(),s4[1+j].end());
      |                   ^~~~~~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:23:19: error: 'substr' was not declared in this scope; did you mean 'strstr'?
   23 |         string s2=substr(i,i+j);
      |                   ^~~~~~
      |                   strstr
/in/foo.cc:31:2: error: expected '}' at end of input
   31 | }
      |  ^
/in/foo.cc:15:11: note: to match this '{'
   15 | int main(){
      |           ^

信息

递交者
类型
递交
题目
P2422 1.7.34回文子串
语言
C++
递交时间
2026-02-24 15:33:21
评测时间
2026-02-24 15:33:21
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes