#ABC471G. 凯撒音节 / Caeser Syllables
凯撒音节 / Caeser Syllables
题目描述
There are kinds of symbols numbered to .
Each symbol is either a vowel or not a vowel. If , symbol is a vowel; if , symbol is not a vowel.
Define the number of syllables of a symbol string as the number of maximal contiguous substrings of that string consisting of vowels. Formally, the number of syllables of a length- symbol string is defined as the number of pairs of integers satisfying and all of the following:
- The symbols are all vowels.
- If , symbol is not a vowel.
- If , symbol is not a vowel.
You are given a length- sequence . For each , answer the following question:
- Define a length- symbol string by . What is the number of syllables of ?
输入格式
The input is given from Standard Input in the following format:
输出格式
Output lines. The -th line () should contain the answer for .
数据范围
- ()
- ()
- ()
- All input values are integers.
4 6 12233445577788999 4
4 2 4 1
1 1 0 0 1 0
2
0
1
2
1
2
In this input, .
- For , , and the number of syllables is .
- For , , and the number of syllables is .
- For , , and the number of syllables is .
- For , , and the number of syllables is .
- For , , and the number of syllables is .
- For , , and the number of syllables is .
15 12 998154573227378904 2
5 6
0 0 1 1 0 1 0 0 1 1 0 1
4
4
3
3
3
4
4
4
3
3
3
4
In this input, .
7000000 15 409873722375451899 3
7 0 4
1 0 1 1 1 0 1 1 1 0 1 0 1 0 0
1680078
1681239
1679837
1680730
1680470
1679454
1679615
1679371
1681263
1679670
1680218
1680010
1680211
1680521
1681744
补充说明
Input Format
The input for this problem is given in a special format.
Instead of , the integers are given from Standard Input. Restore using the computation represented by the following pseudocode.
Here, all variables in the pseudocode are unsigned -bit integers. denotes the bitwise XOR of and , denotes (the right shift operation), and denotes (the left shift operation).
state <- seed
for i = 1, ..., N:
if i <= M:
A_i <- b_i
else:
x <- (((state >> 18) XOR state) >> 27) mod 2^32
r <- state >> 59
y <- ((x >> r) + (x << (32-r))) mod 2^32
A_i <- y mod K
state <- (state * 6364136223846793005 + 2026081520260815) mod 2^64
相关
在下列比赛中: