시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 512 MB | 67 | 43 | 33 | 67.347% |
The 2017 International Congress of Monsters gathers n monsters coming from all over the world. Their chairman has to solve the following problem: if the ith monster (1 ≤ i ≤ n) has ki fingers, indexed from 0 to ki - 1, so he can lift j of those fingers (0 ≤ j ≤ ki), obtaining a certain number, in the following way: if a certain finger is lifted, 2finger index is added to the current number. As a result, the ith monster can count on his fingers nri distinct numbers. Therefore, the demanded result is nr1 + nr2 + … + nrn, modulo 109+7.
Compute the required sum, modulo 109+7.
The first line of the input contains the number n.
The second line contains n positive integers, k1, k2, …, kn, representing the numbers of fingers of each monster.
The output must contain a single positive integer, the requested sum, modulo 109+7.
2 3 7
136
The first monster can obtain 8 numbers:
The second monster can obtain 128 numbers.