Category
Similar Problems
0751. Count Fibonacci numbers
Time limit : 1000 ms
Memory limit : 64 mb
Fibonacci sequence - it's a sequence in which each element is equal to the sum of the two previous ones, except for the first two elements of F1 = 1, F2 = 1, Fn = Fn-2 + Fn-1.
1 1 2 3 5 8 13 21 …
Given an array of integers, of which perhaps is the Fibonacci numbers. Count the Fibonacci numbers in a given set of numbers.
Input
The first line contains the number k - the number of numbers in the next line contains k integers a1,a2, …, ak (0 < k ≤ 105, 1 ≤ ai < 263).
Output
Print a single number - the count of Fibonacci numbers.
Samples
№ |
Input |
Output |
1 |
5 1 3 5 6 13 |
4 |
s
Text from: e-olimp.com