Prime Ring Problem Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 41154 Accepted Submission(s): ...
分类:
其他好文 时间:
2016-05-28 18:56:33
阅读次数:
133
简洁既是美,程序员应尽量尝试编写简洁的表达式,争取用简单的代码来实现更多的功能,当然,这也要看情况了(有时候也得考虑程序运行的时间嘛)。 在阅读C++Prime Plus到while语句时有一个讲一个数组内容复制到另一个数组的例子: //arr1 is an array if ints int *s ...
分类:
编程语言 时间:
2016-05-27 20:01:44
阅读次数:
225
Anti-prime Sequences Time Limit: 3000MS Memory Limit: 30000K Total Submissions: 3355 Accepted: 1531 Description Given a sequence of consecutive intege ...
分类:
其他好文 时间:
2016-05-27 14:26:09
阅读次数:
233
Largest prime factor
Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 10004 Accepted Submission(s): 3534
Problem Description
Ever...
分类:
其他好文 时间:
2016-05-27 12:29:18
阅读次数:
186
题目链接:http://www.codechef.com/problems/PRIMEDST/ 题意:给出一棵树,边长度都是1。每次任意取出两个点(u,v),他们之间的长度为素数的概率为多大? 树分治,对于每个根出发记录边的长度出现几次,然后每次求卷积,用素数表查一下即可添加答案。 ...
分类:
其他好文 时间:
2016-05-26 20:35:24
阅读次数:
219
看完C prime plus(第五版)第十二章,随带完成了后面的习题。 1.不使用全局变量,重写程序清单12.4的程序。 先贴出12.4的程序,方便对照; 1 /* global.c 使用外部变量 */ 2 #include <stdio.h> 3 int units = 0; //一个外部变量 4 ...
分类:
其他好文 时间:
2016-05-25 23:45:05
阅读次数:
357
盗一波素数筛 const int mx = 1000000 + 1; ///在(1,mx)的范围内寻找素数 const int sqrt_mx = (int)sqrt((double)mx); bool vis[mx]; int prime[mx / 10]; ///在mx>65000时建议写成 i ...
分类:
其他好文 时间:
2016-05-25 18:49:28
阅读次数:
112
Yada Number Problem Description: Every positive integer can be expressed by multiplication of prime integers. Duoxida says an integer is a yada number ...
分类:
其他好文 时间:
2016-05-24 16:44:33
阅读次数:
175
Description: Count the number of prime numbers less than a non-negative number, n. ...
分类:
其他好文 时间:
2016-05-23 22:30:46
阅读次数:
181
1 const MAX=1000000; 2 var Prime:array[0..MAX] of longint; 3 v:array[0..MAX] of boolean; 4 5 procedure GetPrime; 6 var i,j,tmp,size:longint; 7 begin 8 ...
分类:
其他好文 时间:
2016-05-23 21:24:39
阅读次数:
235