100 atcoder#ABC209C. [ABC209C] Not Equal
[ABC209C] Not Equal
Score : points
Problem Statement
You are given a sequence of integers. Find the number of sequences of integers satisfying all of the following conditions.
Since the count may be enormous, print it modulo .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the number of sequences of integers satisfying all of the following conditions, modulo .
2
1 3
2
We have two sequences satisfying all of the conditions: and . On the other hand, , for example, does not satisfy the second condition.
4
3 3 4 4
12
2
1 1
0
We have no sequences satisfying all of the conditions, so we should print .
10
999999917 999999914 999999923 999999985 999999907 999999965 999999914 999999908 999999951 999999979
405924645
Be sure to print the count modulo .