码迷,mamicode.com
首页 >  
搜索关键字:calculate prime s    ( 3428个结果
pat 1015 Reversible Primes(20 分)
A reversible prime in any number system is a prime whose "reverse" in that number system is also a prime. For example in the decimal system 73 is a re ...
分类:其他好文   时间:2018-09-03 17:20:31    阅读次数:170
线性筛
prime[]数组中的素数是递增的,当i能整除prime[j],那么i*prime[j+1]这个合数肯定被prime[j]乘以某个数筛掉。 因为i中含有prime[j],prime[j]比prime[j+1]小,即i=k*prime[j],那么i*prime[j+1]=(k*prime[j])*pr... ...
分类:其他好文   时间:2018-09-02 23:50:03    阅读次数:150
南京网络赛题解 2018
J. Sum A square-free integer is an integer which is indivisible by any square number except 111. For example, 6=2?36 = 2 \cdot 36=2?3 is square-free, ...
分类:其他好文   时间:2018-09-02 14:36:09    阅读次数:302
ubuntu上的疑难杂症(不定期更新……)
ubuntu系统英伟达显卡驱动怎么装 这样装完之后,可能还会遇到开机后无法登录,一直在登录界面循环的问题,解决办法是: ubuntu下安装搜狗拼音的最便捷方法 先下载安装包,deb格式的,然后执行 之后会提示你缺少依赖,这个时候再执行: 然后进入系统设置 语言支持,把键盘输入方法由ibus改为fci ...
分类:系统相关   时间:2018-09-02 11:08:54    阅读次数:298
POJ3292 Semi-prime H-numbers [数论,素数筛]
题目传送门 Semi-prime H-numbers Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 10871 Accepted: 4881 Description This problem is based on an exe ...
分类:其他好文   时间:2018-09-02 11:05:08    阅读次数:184
求解范围中 gcd(a,b)== prime 的有序对数
题目: 给定整数N,求1<=x,y<=N且Gcd(x,y)为素数的数对(x,y)有多少对. 输入: 一个整数N。 输出: 如题。 Sample Input 4 Sample Output 4 Hint 对于样例(2,2),(2,4),(3,3),(4,2) 1<=N<=10^7 思路: 对于本题,因 ...
分类:其他好文   时间:2018-08-31 21:28:16    阅读次数:203
HDU - 1973 - Prime Path (BFS)
Prime Path Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 987 Accepted Submission(s): 635 Proble ...
分类:其他好文   时间:2018-08-31 21:04:43    阅读次数:205
1088 Rational Arithmetic(20 分)
For two rational numbers, your task is to implement the basic arithmetics, that is, to calculate their sum, difference, product and quotient. Input Sp ...
分类:其他好文   时间:2018-08-31 17:09:12    阅读次数:191
1081 Rational Sum(20 分)
Given N rational numbers in the form numerator/denominator, you are supposed to calculate their sum. Input Specification: Each input file contains one ...
分类:其他好文   时间:2018-08-31 10:49:51    阅读次数:232
POJ 3126 Prime Path【BFS】
<题目链接> 题目大意: 给你两个四位数,它们均为素数,以第一个四位数作为起点,每次能够变换该四位数的任意一位,变换后的四位数也必须是素数,问你是否能够通过变换使得第一个四位数变成第二个四位数。 解题分析: 先打一张素数表,然后进行BFS搜索,对于每次搜索的当前数,枚举某一位与它不同的所有数,判断它 ...
分类:其他好文   时间:2018-08-31 00:27:55    阅读次数:170
3428条   上一页 1 ... 64 65 66 67 68 ... 343 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!