hdu4927 Series 1(组合+公式 Java大数高精度运算)...
分类:
编程语言 时间:
2014-08-07 23:13:55
阅读次数:
347
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4927解题报告:对于n,结果如下:C(0,n-1) *A[n] - C(1,n-1) * A[n-1] + C(2,n-1) * A[n-2] - C(3,n-1) * A[n-3] ....... C(...
分类:
其他好文 时间:
2014-08-07 22:42:15
阅读次数:
289
题目链接:hdu 4927 Series 1
题目大意:给定一个长度为n的序列a,每次生成一个新的序列,长度为n-1,新序列b中bi=ai+1?ai,直到序列长度为1.输出最后的数。
解题思路:n最多才3000,ai最大也才1000,貌似不会超int,但是要注意,有些数不止被计算了一次,最多的数被计算了C(15003000),所以肯定要用高精度处理,那么用o(n2)的复杂度肯定就跪了。...
分类:
其他好文 时间:
2014-08-07 18:57:40
阅读次数:
237
Time Limit:2000MSMemory Limit:65536KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeURAL 1036DescriptionYou are given a number 1 ≤N≤ 50. Every ticke...
分类:
其他好文 时间:
2014-08-03 20:18:45
阅读次数:
433
Description
Your rich uncle died recently, and the heritage needs to be divided among your relatives and the church (your uncle insisted in his will that the church must get something). There are...
分类:
其他好文 时间:
2014-07-31 17:15:36
阅读次数:
223
Description
Recall the definition of the Fibonacci numbers:
f1 := 1
f2 := 2
fn := fn-1 + fn-2 (n>=3)
Given two numbers a and b, calculate how many Fibonacci numbers are in the range...
分类:
其他好文 时间:
2014-07-31 17:11:07
阅读次数:
325
Description
Problems involving the computation of exact values of very large magnitude and precision are common. For example, the computation of the national debt is a taxing experience for many ...
分类:
其他好文 时间:
2014-07-31 17:08:06
阅读次数:
267
//算法:获得无小数点的输入串,然后对该串进行普通的高精度乘法运算
//运算得到结果后,添加小数点,最后除去串头和串尾的0即可
#include
#define MAXN 200
char R[10];
char E[6];//寄存无小数点的输入串
char temp[MAXN];
char ans[MAXN];//寄存答案串
int n,left;
void multip();
int ...
分类:
其他好文 时间:
2014-07-31 00:08:15
阅读次数:
269
问题描述:键盘输入一个高精度的正整数N(不超过240位),去掉其中任意M个数字后剩下的数字按原左右次序将组成一个新的正整数。编程对给定的N和M,寻找一种方案使得剩下的数字组成的新数最小。输出组成的新的正整数。输入数据均不需判错。如果去掉了某几个位后得到的新整数开头为0,保留0。输入:本题有多组测试数...
分类:
其他好文 时间:
2014-07-30 23:09:05
阅读次数:
224