Submit | All submissions | Best solutions | Back to list |
NSUBSTR - Substrings |
You are given a string S which consists of 250000 lowercase latin letters at most. We define F(x) as the maximal number of times that some string with length x appears in S. For example for string 'ababa' F(3) will be 2 because there is a string 'aba' that occurs twice. Your task is to output F(i) for every i so that 1<=i<=|S|.
Input
String S consists of at most 250000 lowercase latin letters.
Output
Output |S| lines. On the i-th line output F(i).
Example
Input:
ababa
Output:
3
2
2
1
1
Added by: | Sergey Kulik |
Date: | 2011-01-27 |
Time limit: | 0.100s-1s |
Source limit: | 44444B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All |
Resource: | Immagination |
hide comments
|
|||||
2011-08-22 15:06:20 jagd
Time limit: 1s-2s ? |
|||||
2011-08-22 15:06:20 Husnun Nashir
please give me more test case |
|||||
2011-08-22 15:06:20 ymGXX
nice problem.I got AC after I found some mistakes. |
|||||
2011-08-22 15:06:20 Siarhei Kulik
The judge is OK now. Try to resubmit your solution. |
|||||
2011-08-22 15:06:20 ymGXX
Why I'm waiting for so long? |