| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 1024 MB | 156 | 39 | 29 | 26.126% |
bobo loves geometric progressions! So he wants to know the number of geometric progressions of length 3ドル$ in a sequence $a_1, a_2, \dots, a_n$.
That is to say, count the number of $(i, j, k)$ where $i < j < k$ and $a_{i} \cdot a_{k} = a_j^2$.
The first line contains an integer $n$ (1ドル \leq n \leq 1000000$).
The second line contains $n$ integers $a_1, a_2, \dots, a_n$ (1ドル \leq a_1 < a_2 < \dots < a_n \leq 1000000$).
A single integer denotes the number of geometric progressions.
3 1 2 4
1
4 1 2 4 8
2