摘要:
Problem DescriptionFibonacci数列,定义如下:f(1)=f(2)=1f(n)=f(n-1)+f(n-2) n>=3。计算第n项Fibonacci数值。Input输入第一行为一个整数N,接下来N行为整数Pi(1<=Pi<=1000)。Output输出为N行,每行为对应的f(Pi)。Sample Input512345Sample Output11235Source 2007省赛集训队练习赛(2) Recommendlcy 用一个二维数组存放斐波那契数,第一个维表示 第几个斐波那契数,第二位是该斐波那契数属于的最大长度; 然后用查表的方式进行查询,这样的 阅读全文
摘要:
ExponentiationTime Limit: 1000/500 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5265Accepted Submission(s): 1430Problem DescriptionProblems involving the computation of exact values of very large magnitude and precision are common. For example, the computation of the 阅读全文