| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 512 MB | 479 | 118 | 93 | 26.124% |
You are given a function $f ,円 : ,円 \mathbb{N}_0 \to \mathbb{N}_0$ defined as below. ($\mathbb{N}_0$ denotes the set of non-negative integers.)
Find the value of $f(n)$ modulo $m$.
The first line contains a single integer $n$.
The second line contains $n + 1$ integers $a_0, ,円 a_1, ,円 \cdots, ,円 a_n$.
The third line contains a single integer $m$.
Print the value of $f(n)$ modulo $m$.
2 2 3 2 11
6
$f(0) = 2,ドル $f(1) = 3^2 = 9,ドル $f(2) = 2^9 = 512$.
The value of 512ドル$ modulo 11ドル$ is 6ドル$.
As a note, the exact value of 9ドル^{9^9}$ has a whopping 369ドル ,円 693 ,円 700$ digits.