码迷,mamicode.com
首页 >  
搜索关键字:calculate prime s    ( 3428个结果
PHP根据两个经纬度坐标计算距离
function?radian($d)?{ ????????????$d?*?3.1415926535898?/?180.0;?? } function?distance_calculate($longitude1,?$latitude1,?$longitude2,?$latitude2)?{ ???????????...
分类:Web程序   时间:2014-08-22 13:10:19    阅读次数:209
UVa10099_The Tourist Guide(最短路/floyd)(小白书图论专题)
解题报告 题意: 有一个旅游团现在去出游玩,现在有n个城市,m条路。由于每一条路上面规定了最多能够通过的人数,现在想问这个旅游团人数已知的情况下最少需要运送几趟 思路: 求出发点到终点所有路当中最小值最大的那一条路。 求发可能有多种,最短路的松弛方式改掉是一种,最小生成树的解法也是一种(ps,prime和dijs就是这样子类似的) #include #include #incl...
分类:其他好文   时间:2014-08-22 02:47:25    阅读次数:194
UVA 题目11292 Dragon of Loowater
Problem C: The Dragon of Loowater Once upon a time, in the Kingdom of Loowater, a minor nuisance turned into a major problem. The shores of Rellau Creek in central Loowater had always been a prime...
分类:其他好文   时间:2014-08-21 17:23:54    阅读次数:153
Prime Cuts(poj1595)
/*Prime Cuts Description A prime number is a counting number (1, 2, 3, ...) that is evenly divisible only by 1 and itself. In this problem you are to write a program that will cut some number of pri...
分类:其他好文   时间:2014-08-21 17:14:24    阅读次数:283
uva 10780 Again Prime? No Time.
POINT : 质因子分解;(仅给题解)http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=1721题意:给你两个整数m和n,求最大的k使...
分类:其他好文   时间:2014-08-21 14:50:14    阅读次数:233
Prime Palindromes
题目大意:求出区间[a,b]之间的回文质数。 a10000)13 break;14 check[c]=true;15 if (i % prime[j]==0)16 break;17 ...
分类:其他好文   时间:2014-08-21 14:34:14    阅读次数:192
Cracking the Coding Interview 8.7
Given a infinite number of quarters(25cents), dimens(10cents), nickels(5cents) and pennies(1cent), write code to calculate the number of ways of repre...
分类:其他好文   时间:2014-08-21 12:56:04    阅读次数:260
[POJ 2407]Relatives(欧拉函数)
Description Given n, a positive integer, how many positive integers less than n are relatively prime to n? Two integers a and b are relatively prime if there are no integers x > 1, y > 0, z > 0 such ...
分类:其他好文   时间:2014-08-20 22:41:13    阅读次数:264
斐波拉切字符串统计个数 Fibonacci String
Problem:  s0 = "a", s1 = "b", s2 = "ba", s3 = "bab", s4 = "babba", s4 = "babbabab", is called Fibonacci string. For the string with index n, given a string str = "bb", calculate how many times in the...
分类:其他好文   时间:2014-08-20 12:31:22    阅读次数:146
【模版】素数筛, 最大公约数(辗转相除法),最小公倍数
素数筛: //数除了{2,3,5}为素数,其他的数可以写成6N,6N+1,6N+2,6N+3,6N+4,6N+5 N>=1 可以表示全部的数 //6N,6N+2,6N+4都为偶数,不是素数,6N+3 == 3(2N+1) 不是素数,那么就只筛6N+1和6N+5就可以了 int prime[1000000]={2,3,5}; void is_prime() { int i,j; ...
分类:其他好文   时间:2014-08-19 20:58:25    阅读次数:237
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!