#P1688. Powers of Two
Powers of Two
Powers of Two
题面翻译
给一个长度为的序列
从中选取,使
求序列中有多少对这样的数
:
样例1:有两对数
题目描述
You are given integers . Find the number of pairs of indexes ( i<j ) that is a power of (i. e. some integer exists so that ).
输入格式
The first line contains the single positive integer ( ) — the number of integers.
The second line contains positive integers ( ).
输出格式
Print the number of pairs of indexes ( i<j ) that is a power of .
样例 #1
样例输入 #1
4
7 3 2 1
样例输出 #1
2
样例 #2
样例输入 #2
3
1 1 1
样例输出 #2
3
提示
In the first example the following pairs of indexes include in answer: and .
In the second example all pairs of indexes (where i<j ) include in answer.