
杭电大数专题
文章平均质量分 76
hui1570
这个作者很懒,什么都没留下…
展开
-
杭电ACM 1041 Computer Transformation
/*这一题首先要分析、找规律:shu[i]=shu[i-1]*2+1(i是偶数) shu[i]=shu[i-1]*2-1(i是奇数)又因为计算结果非常大,所以要用到大数*/ #include#includeint shu[1010][1010];//定义数组来存放 0—1000的所有运算结果 int main(){原创 2014-07-28 21:13:02 · 581 阅读 · 0 评论 -
杭电ACM 1753 大明A+B(大数:正小数加法)
大明A+BProblem Description话说,经过了漫长的一个多月,小明已经成长了许多,所以他改了一个名字叫“大明”。这时他已经不是那个只会做100以内加法的那个“小明”了,现在他甚至会任意长度的正小数的加法。现在,给你两个正的小数A和B,你的任务是代表大明计算出A+B的值。 Input本题目包含多组测试数据,请处理到文件结束。每一组测试数据原创 2014-07-30 11:51:41 · 1312 阅读 · 1 评论 -
杭电ACM 1715 大斐波数
大菲波数Problem DescriptionFibonacci数列,定义如下:f(1)=f(2)=1f(n)=f(n-1)+f(n-2) n>=3。计算第n项Fibonacci数值。 Input输入第一行为一个整数N,接下来N行为整数Pi(1 Output输出为N行,每行为对应的f(Pi)。 Sample Input原创 2014-07-30 13:22:28 · 858 阅读 · 3 评论 -
杭电ACM 1250 Hat's Fibonacci (还需再看)
Hat's FibonacciTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7384 Accepted Submission(s): 2407Problem DescriptionA Fibonacci se原创 2014-07-29 21:15:38 · 567 阅读 · 0 评论 -
杭电ACM 1865 listing
1stingProblem DescriptionYou will be given a string which only contains ‘1’; You can merge two adjacent ‘1’ to be ‘2’, or leave the ‘1’ there. Surly, you may get many different results. For exampl原创 2014-07-30 08:56:06 · 380 阅读 · 0 评论 -
杭电ACM 2100 Lovekey
LovekeyProblem DescriptionXYZ-26进制数是一个每位都是大写字母的数字。 A、B、C、…、X、Y、Z 分别依次代表一个0 ~ 25 的数字,一个 n 位的26进制数转化成是10进制的规则如下A0A1A2A3…An-1 的每一位代表的数字为a0a1a2a3…an-1 ,则该XYZ-26进制数的10进制值就为 m = a0 * 26^(n-1) + a1原创 2014-07-29 21:27:12 · 605 阅读 · 0 评论 -
杭电ACM 1568 Fibonacci (还需再看)
FibonacciTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3425 Accepted Submission(s): 1558Problem Description2007年到来了。经过2006年一年的修原创 2014-07-29 19:27:51 · 511 阅读 · 0 评论 -
杭电ACM 1047 Integer Inquiry
Integer InquiryProblem DescriptionOne of the first users of BIT's new supercomputer was Chip Diller. He extended his exploration of powers of 3 to go from 0 to 333 and he explored taking various s原创 2014-07-28 21:44:21 · 595 阅读 · 0 评论 -
杭电1041 Computer Transformation
Computer TransformationTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5856 Accepted Submission(s): 2122Problem DescriptionA sequ原创 2014-07-28 17:51:16 · 495 阅读 · 0 评论 -
杭电ACM 1042 N!(还需再看)
//计算 N!的斯特林公式:n!=(sqrt(2*pi*n))(n/e)^n,如果用这个公式计算 N!因为数太大还是不可以用来计算 所以还是要用大数乘法计算//高精度问题 :大数乘法的应用//核心思想就是把计算结果每一位上的数字保存到一个数组成员中,例如://把124保存到数组中,保存结果应该是result【0】=4,result【1】=2,result【2】=1//把整个数组原创 2014-07-28 21:08:20 · 851 阅读 · 0 评论 -
杭电ACM 1230 火星A+B
#include #include#include#define max(a,b) (a>b?a:b)int s[]={2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101};int main(){ int a1[100],a2[100],a[100],i,j原创 2014-08-07 16:20:26 · 525 阅读 · 0 评论