1621: 子串计算

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

给出一个只包含0和1的字符串(长度在1到100之间),求其每一个子串出现的次数。

Input

一行,一个01字符串。

Output

对所有出现次数在1次以上的子串,输出该子串及出现次数,中间用单个空格隔开。按子串的字典序从小到大依次输出,每行一个。

Sample Input Copy

10101

Sample Output Copy

0 2
01 2
1 3
10 2
101 2

Source/Category