Haiku is a short form of Japanese poetry. A Haiku consists of three phrases with 5, 7 and 5 syllables, in this order.
Iroha is looking for X,Y,ZX,Y,Z-Haiku (defined below) in integer sequences.
Consider all integer sequences of length NN whose elements are between 11 and 1010, inclusive. Out of those 10N10N sequences, how many contain an X,Y,ZX,Y,Z-Haiku?
Here, an integer sequence a0,a1,...,aN−1a0,a1,...,aN−1 is said to contain an X,Y,ZX,Y,Z-Haiku if and only if there exist four indices x,y,z,w(0≦x Since the answer can be extremely large, print the number modulo 109+7109+7. The input is given from Standard Input in the following format: Print the number of the sequences that contain an X,Y,ZX,Y,Z-Haiku, modulo 109+7109+7. Copy Copy Here, the only sequence that contains a 5,7,55,7,5-Haiku is [5,7,5][5,7,5]. Copy Copy Copy Copy Copy Copy 题意: N->数的长度(N个数)每个数只能是(0-10), 问你有多少x,y,z,w。满足上面的要求。 d[i][s]表示考虑到第i位,第x+y+z为1然后后面的串为s的二进制表示的数。 转移时枚举第i+1位的情况即可
Constraints
Input
NN XX YY ZZ
Output
Sample Input 1 Copy
3 5 7 5
Sample Output 1 Copy
1
Sample Input 2 Copy
4 5 7 5
Sample Output 2 Copy
34
Sample Input 3 Copy
37 4 2 3
Sample Output 3 Copy
863912418
Sample Input 4 Copy
40 5 7 5
Sample Output 4 Copy
562805100
给你N,X,Y,Z;#include