Ubiquity SOLUTION AtCoder Contest 178

Ubiquity SOLUTION
Problem Statement
How many integer sequences A1,A2,…,AN of length N satisfy all of the following conditions?
0≤Ai≤9 There exists some i such that Ai=0 holds.There exists some i such that Ai=9 holds.
The answer can be very large, so output it modulo 109+7.
Constraints
1≤N≤106
N is an integer.
Input
Input is given from Standard Input in the following format: N
Output
Print the answer modulo 109+7
.
Sample Input 1
Copy
2
Sample Output 1
Copy
2
Two sequences
{0,9} and {9,0} satisfy all conditions.
Sample Input 2
Copy
1
Sample Output 2
Copy
0
Sample Input 3
Copy
869121
Sample Output 3
Copy
2511445

Leave a Comment

close
error: Content is protected !!