
3.打表
文章平均质量分 74
DTL66
细节决定成败
展开
-
素数判定
素数判定Problem Description对于表达式n^2+n+41,当n在(x,y)范围内取整数值时(包括x,y)(-39Input输入数据有多组,每组占一行,由两个整数x,y组成,当x=0,y=0时,表示输入结束,该行不做处理。Output对于每个给定范围内的取值,如果表达式的值都为素数,则输出"OK",否则请输出“Sorry”,每组输出占一行。原创 2016-07-20 19:22:45 · 565 阅读 · 0 评论 -
LIGHT OJ 1064 - Throwing Dice 【dp数塔+打表】
1064 - Throwing Dice PDF (English)StatisticsForumTime Limit: 2 second(s)Memory Limit: 32 MBn common cubic dice are thrown. What is the probability tha原创 2016-08-26 01:29:22 · 373 阅读 · 0 评论 -
Uva-10200 Prime Time 【素数+打表+浮点精度】
10200 - Prime TimeEuler is a well-known matematician, and, among many other things, he discovered that the formula n 2 + n + 41 produces a prime for 0 ≤ n < 40. For n = 40, the formula produces 1681,原创 2016-08-14 00:05:40 · 445 阅读 · 0 评论 -
HDU-4907 Task schedule
J - Task scheduleTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u SubmitStatus Description 有一台机器,并且给你这台机器的工作表,工作表上有n个任务,机器在ti时间执行第i个任务,1秒即可完成1个任务。 有m个询问,每个询问有一个数字q,表示如果原创 2016-07-27 17:06:57 · 378 阅读 · 0 评论 -
Codeforces-546D Soldier and Number Game 【质因子分解+打表+DP】
D. Soldier and Number Game time limit per test3 seconds memory limit per test256 megabytes inputstandard input outputstandard output Two soldiers are playing a game. At the beginning first of them原创 2016-08-13 21:53:04 · 446 阅读 · 0 评论 -
素数表学习总结
素数表的打法多种多样,每种都有其特点,学习了几种,总结一下。 思路:第四种:从小到大判断素数,再用素数的倍数是合数筛去合数,保留素数 ,重复性高;第三种是根据一个合数的最小质因子《=sqrt(N) 来筛选;第一种将不必要的访问去除,通过一个合数的最小素因子将其筛去,大大优化了时间复杂度; 如果需要将素数存起来,这时标记和保存数组就可以用一个了,素数0,1位置开始存都可以 prime[0]=2,pr原创 2016-08-17 23:45:46 · 433 阅读 · 0 评论 -
I - the Sum of Cube
I - the Sum of CubeTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u SubmitStatus Description A range is given, the begin and the end are both integers. You should su原创 2016-07-20 21:36:34 · 262 阅读 · 0 评论 -
H - 不要62
H - 不要62========Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmitStatusDescription杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)。 杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来,原创 2016-07-20 21:31:42 · 448 阅读 · 0 评论 -
G - 美素数
G - 美素数Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u SubmitStatus Description 小明对数的研究比较热爱,一谈到数,脑子里就涌现出好多数的问题,今天,小明想考考你对素数的认识。 问题是这样的:一个十进制数,如果是素数,而且它的各位数字和也是素数,则原创 2016-07-20 21:12:15 · 977 阅读 · 0 评论 -
F - 分拆素数和
F - 分拆素数和Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u SubmitStatus Description 把一个偶数拆成两个不同素数的和,有几种拆法呢?Input 输入包含一些正的偶数,其值不会超过10000,个数不会超过500,若遇0,则结束。Output 对应每个偶数,输原创 2016-07-20 21:00:21 · 444 阅读 · 0 评论