问题3436--Count the algorithms

3436: Count the algorithms

[命题人 : ]
时间限制 : 1.000 sec  内存限制 : 64 MB

题目描述

Please Count how many sub strings of “algorithms” is there in the given string. For a given string S, find how many different sub strings s[i] (s[i-1] < s[i],1 <= i < 10), that S[si] is “algorithms”. For the answer may be very big, mod 2012031815.

输入

Line 1 is an integer N ( N <= 100 ) indicate the number of test cases. N line followed , every line contains a string S (the length of S is not greater than 10000, all the letter will be lower case )

输出

N Lines each line is the answer of the test case.

样例输入 Copy

3
algorithms
aalgorithms
lgorithmsa

样例输出 Copy

1
2
0

来源/分类

tyh