delete pics to save space

This commit is contained in:
2023-08-03 09:22:52 +08:00
commit de60cd6ed4
1334 changed files with 66221 additions and 0 deletions

29
2.1328.cpp Normal file
View File

@ -0,0 +1,29 @@
#include<cstdio>
#include<cassert>
using namespace std;
const int maxn=1000010;
char p[maxn];
int f[maxn];
int main()
{
#ifdef local
freopen("pro.in","r",stdin);
#endif
int n,kase=0;
while(scanf("%d",&n)==1&&n)
{
scanf("%s",p);
for(int i=1;i<n;i++)
{
int j=f[i];
while(j&&p[i]!=p[j]) j=f[j];
f[i+1]=(p[i]==p[j]?j+1:0);
}
printf("Test case #%d\n",++kase);
for(int i=2;i<=n;i++)
if(f[i]>0&&i%(i-f[i])==0)
printf("%d %d\n",i,i/(i-f[i]));
printf("\n");
}
return 0;
}