求程序,C/C++/java均可,该如何解决
求程序,急!C/C++/java均可
题目一:
时间限制:10000ms
单点时限:1000ms
内存限制:256MB
描述
Given a sequence {an}, how many non-empty sub-sequence of it is a prefix of fibonacci sequence.
A sub-sequence is a sequence that can be derived from another sequence by deleting some elements without changing the order of the remaining elements.
The fibonacci sequence is defined as below:
F1 = 1, F2 = 1
Fn = Fn-1 + Fn-2, n>=3
输入
One line with an integer n.
Second line with n integers, indicating the sequence {an}.
For 30% of the data, n<=10.
For 60% of the data, n<=1000.
For 100% of the data, n<=1000000, 0<=ai<=100000.
输出
One line with an integer, indicating the answer modulo 1,000,000,007.
样例提示
The 7 sub-sequences are:
{a2}
{a3}
{a2, a3}
{a2, a3, a4}
{a2, a3, a5}
{a2, a3, a4, a6}
{a2, a3, a5, a6}
样例输入
6
2 1 1 2 2 3
样例输出
7
------解决思路----------------------
没太懂什么意思,翻译一下吧
------解决思路----------------------
ACM题吧?
------解决思路----------------------
不是不想帮你,是实在英语不好
------解决思路----------------------
不是不想帮你,是不想去看英语
------解决思路----------------------
很好的题,这是笔试题吧
题目一:
时间限制:10000ms
单点时限:1000ms
内存限制:256MB
描述
Given a sequence {an}, how many non-empty sub-sequence of it is a prefix of fibonacci sequence.
A sub-sequence is a sequence that can be derived from another sequence by deleting some elements without changing the order of the remaining elements.
The fibonacci sequence is defined as below:
F1 = 1, F2 = 1
Fn = Fn-1 + Fn-2, n>=3
输入
One line with an integer n.
Second line with n integers, indicating the sequence {an}.
For 30% of the data, n<=10.
For 60% of the data, n<=1000.
For 100% of the data, n<=1000000, 0<=ai<=100000.
输出
One line with an integer, indicating the answer modulo 1,000,000,007.
样例提示
The 7 sub-sequences are:
{a2}
{a3}
{a2, a3}
{a2, a3, a4}
{a2, a3, a5}
{a2, a3, a4, a6}
{a2, a3, a5, a6}
样例输入
6
2 1 1 2 2 3
样例输出
7
------解决思路----------------------
没太懂什么意思,翻译一下吧
------解决思路----------------------
ACM题吧?
------解决思路----------------------
不是不想帮你,是实在英语不好
------解决思路----------------------
不是不想帮你,是不想去看英语
------解决思路----------------------
很好的题,这是笔试题吧