- 魔族密码
- 2018-02-06 16:23:00 @
#include<cstdio>
#include<iostream>
#include<cstring>
using namespace std;
int n,f[2001],ans=0;
char s[2001][101];
int main()
{
cin >> n;
for (int i=1;i<=n;i++)
scanf("%s",&s[i]);
for (int i = 1;i <= n;i++)
{
for(int j = 1;j < i;j++)
{
if (strstr(s[i],s[j])==s[i])/* !!!*/
{
f[i] = f[j] + 1;
}
}
}
for (int i = 1;i <= n;i++)
{
ans=max(ans,f[i]);
}
cout << ans << endl;
return 0;
}
求解释
2 条评论
-
群殴坏人 LV 4 @ 2018-02-06 16:31:41
max()没有调用好像
-
2018-02-06 16:30:42@
哪道题哦这是
- 1