Compile Error

/in/foo.cc: In function 'int check_new(std::string&, int, int)':
/in/foo.cc:15:25: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |                 if(j_end>=s2.size()||j_end)continue;
      |                    ~~~~~^~~~~~~~~~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:32:16: error: 'substr' was not declared in this scope; did you mean 'strstr'?
   32 |         int s2=substr(l,j);
      |                ^~~~~~
      |                strstr
/in/foo.cc:33:15: error: invalid initialization of reference of type 'std::string&' {aka 'std::__cxx11::basic_string<char>&'} from expression of type 'int'
   33 |         if(hw(s2)&&check_new(s2,l,r)){
      |               ^~
/in/foo.cc:3:16: note: in passing argument 1 of 'int hw(std::string&)'
    3 | int hw(string &s2){
      |        ~~~~~~~~^~
/in/foo.cc:33:30: error: invalid initialization of reference of type 'std::string&' {aka 'std::__cxx11::basic_string<char>&'} from expression of type 'int'
   33 |         if(hw(s2)&&check_new(s2,l,r)){
      |                              ^~
/in/foo.cc:11:23: note: in passing argument 1 of 'int check_new(std::string&, int, int)'
   11 | int check_new(string &s2,int l,int r){
      |               ~~~~~~~~^~

信息

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