Geometric Progression
Time limit1sMemory limit1024 MB
Count index triples i<j<k in a strictly increasing array with values up to 1e6 where a_i times a_k equals a_j squared.
- Level
Medium5 of 10
- Topics
- Number theory, Math
- Solved
- No attempts yet
Problem
bobo loves geometric progressions! So he wants to know the number of geometric progressions of length in a sequence .
That is to say, count the number of where and .
Input
The first line contains an integer ().
The second line contains integers ().
Output
A single integer denotes the number of geometric progressions.