Wrong Answer

foo.cc: In function 'bool sNum(std::string, int)':
foo.cc:9:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |                 for(int i=1;i<s.length();i++)
      |                             ~^~~~~~~~~~~
foo.cc:9:17: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
    9 |                 for(int i=1;i<s.length();i++)
      |                 ^~~
foo.cc:11:25: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   11 |                         if(tmp>=k){
      |                         ^~
foo.cc:12:46: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |                                 for(int j=1;j<s.length();)
      |                                             ~^~~~~~~~~~~
foo.cc: In function 'int Solve(std::string, int)':
foo.cc:29:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   29 |         while(j<s.length()){
      |               ~^~~~~~~~~~~
foo.cc:31:24: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   31 |                 while(j<s.length()&&sNum(str,n)){
      |                       ~^~~~~~~~~~~
foo.cc:38:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   38 |         while(i<s.length()){
      |               ~^~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务
# 状态 耗时 内存占用
#1 Wrong Answer Read 4, expect 3. 1ms 384.0 KiB
#2 Accepted 1ms 256.0 KiB
#3 Wrong Answer Read 11, expect 0. 1ms 256.0 KiB
#4 Wrong Answer Read 23, expect 22. 1ms 256.0 KiB

信息

递交者
类型
递交
题目
P1107 最长重复子串k
语言
C++
递交时间
2022-10-04 21:27:42
评测时间
2022-10-04 21:27:43
评测机
分数
25
总耗时
7ms
峰值内存
384.0 KiB