http://acm.hdu.edu.cn/showproblem.php?pid=1715 import java.io.*; import java.util.*; import java.math.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); BigInteger f[] = new BigInteger[1005]; f[1] = B…
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1715 本题采用大数加法即可解决.采用100000000进制速度更快. C++代码如下: #include<iostream> #include<string.h> using namespace std; #define maxn 1000 + 1//最多算到f(1000) #define len 1000//结果最多有1000*8位 int a[maxn][len]; int main(…
题目描述: 源码: 运用Java大数求解. import java.math.BigInteger; import java.util.*; public class Main { //主函数 public static void main(String[] args) { int n, index; BigInteger f1, f2, fn; Scanner cin = new Scanner(System.in); n = cin.nextInt(); for(int i = 0; i <…
How Many Fibs? Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5954 Accepted Submission(s): 2331 Problem Description Recall the definition of the Fibonacci numbers: f1 := 1 f2 := 2 fn := fn-1…