Compile Error

foo.cc:6:2: error: invalid preprocessing directive #inckude; did you mean #include?
    6 | #inckude <iostream>
      |  ^~~~~~~
      |  include
foo.cc: In function 'int main()':
foo.cc:13:20: error: 'cin' was not declared in this scope
   13 |     string s;int k;cin>>s>>k;
      |                    ^~~
foo.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
    5 | #include <cstring>
  +++ |+#include <iostream>
    6 | #inckude <iostream>
foo.cc:14:5: error: 'cout' was not declared in this scope
   14 |     cout<<longestSubStr(s,k);
      |     ^~~~
foo.cc:14:5: note: 'std::cout' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
foo.cc: In function 'int longestSubStr(std::string, int)':
foo.cc:19:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   19 |  if(k<2) return n; if(n<k) return 0;
      |  ^~
foo.cc:19:20: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   19 |  if(k<2) return n; if(n<k) return 0;
      |                    ^~
foo.cc:21:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   21 |     for(i=0;i<n;i++)ch[s[i]-'a']++;i=0;
      |     ^~~
foo.cc:21:36: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   21 |     for(i=0;i<n;i++)ch[s[i]-'a']++;i=0;
      |                                    ^
foo.cc:20:17: warning: unused variable 'm' [-Wunused-variable]
   20 |  int ch[26]={0},m=12,j,khu=2,l,fr=0;
      |                 ^
foo.cc:20:22: warning: unused variable 'j' [-Wunused-variable]
   20 |  int ch[26]={0},m=12,j,khu=2,l,fr=0;
      |                      ^
foo.cc:20:24: warning: unused variable 'khu' [-Wunused-variable]
   20 |  int ch[26]={0},m=12,j,khu=2,l,fr=0;
      |                        ^~~
foo.cc:20:30: warning: unused variable 'l' [-Wunused-variable]
   20 |  int ch[26]={0},m=12,j,khu=2,l,fr=0;
      |                              ^
foo.cc:20:32: warning: unused variable 'fr' [-Wunused-variable]
   20 |  int ch[26]={0},m=12,j,khu=2,l,fr=0;
      |                                ^~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1107 最长重复子串k
语言
C++
递交时间
2022-07-18 12:45:03
评测时间
2022-07-18 12:45:03
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes