上一页 1 ··· 7 8 9 10 11
摘要: 简单的判断互质Uniform GeneratorComputer simulations often require random numbers. One way to generate pseudo-random numbers is via a function of the formwhere ``" is the modulus operator.Such a function will generate pseudo-random numbers (seed) between 0 andMOD-1. One problem with functions of this f 阅读全文
posted @ 2013-10-21 23:41 doubleshik 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 题目大意: 求N! 的最后一位非零数注意根据题目在过程中要保留5位,如果利用数组可以节省数据组之间的时间。Just the FactsThe expressionN!, read as ``Nfactorial," denotes the product of the firstNpositive integers, whereNis nonnegative. So, for example,NN!011122364245120103628800For this problem, you are to write a program that can compute the last 阅读全文
posted @ 2013-10-21 23:03 doubleshik 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 求两个大整数相加。记录一下高精度的模板题目:Integer InquiryOne 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 sums of those numbers.``This supercomputer is great,'' remarked Chip. ``I only wish Timoth 阅读全文
posted @ 2013-10-21 00:31 doubleshik 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 题目大意:找出三维坐标中一个点周围距离[1,2),[2,3),.....的点的个数学习了一下c++ 输出格式控制Tree's a CrowdDr William Larch, noted plant psychologist and inventor of the phrase ``Think like a tree--Think Fig'' has invented a new classification system for trees. This is a complicated system involving a series of measurements 阅读全文
posted @ 2013-10-18 15:24 doubleshik 阅读(324) 评论(0) 推荐(0) 编辑
摘要: 题目大意: 找出一个数在给定的一组数中是第几小,如果不存在就输出notfound运用计数排序来找到第N小一开始做的时候一直错因为 cout 2 #include 3 #include 4 using namespace std; 5 const int maxn =100000; 6 7 int N,M; 8 9 int main()10 {11 int test=1;12 while(scanf("%d %d",&N,&M)==2)13 {14 if(N==0)break;15 int cc[maxn]={0};16 ... 阅读全文
posted @ 2013-10-18 00:02 doubleshik 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 题目大意就是找出国家名字出现了多少次然后排序 输出次数。练习了一下sscanfProblem BList of ConquestsInput:standard inputOutput:standard outputTime Limit:2 secondsIn Act I, Leporello is telling Donna Elvira about his master's long list of conquests:``This is the list of the beauties my master has loved, a list I've made out my 阅读全文
posted @ 2013-10-17 22:04 doubleshik 阅读(259) 评论(0) 推荐(0) 编辑
摘要: Oil DepositsThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid that divides the land into numerous square plots. It then analyzes each plot separately, using sensing 阅读全文
posted @ 2013-10-16 00:02 doubleshik 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 题目 :Matrix Chain MultiplicationSuppose you have to evaluate an expression like A*B*C*D*E where A,B,C,D and E are matrices. Since matrix multiplication is associative, the order in which multiplications are performed is arbitrary. However, the number of elementary multiplications needed strongly depe 阅读全文
posted @ 2013-10-15 12:29 doubleshik 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 算法竞赛入门 P82 5.4.2题目大意: 输入正整数n , 把n! =1*2*3*……*n 分解乘素因子相乘形式,并从大到小输出各个素数的指数。样例输入:553样例输出:5!= 3 1 153! = 49 23 12 8 4 4 3 2 2 1 1 1 1 1 1 1 1 /* 2 算法竞赛入门经典 P82 5.4.2 3 因子和阶乘 4 5 */ 6 7 #include 8 #include 9 10 //判断是否为素数11 int is_prime(int n)12 {13 for(int i=2;i*imaxp)maxp=j;56 ... 阅读全文
posted @ 2013-10-08 21:01 doubleshik 阅读(276) 评论(0) 推荐(0) 编辑
摘要: 类型:计算几何 (算法竞赛入门经典 P88 几何计算题)题目:Problem EThe Other Two TreesInput:standard inputOutput:standard outputTime Limit:2 secondsYou have a quadrilateral shaped land whose opposite fences are of equal length. You have four neighbors whose lands are exactly adjacent to your four fences, thatmeansyou have ... 阅读全文
posted @ 2013-10-08 14:58 doubleshik 阅读(247) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11