码迷,mamicode.com
首页 >  
搜索关键字:calculate prime s    ( 3428个结果
Drupal 7.31 SQL Injection Exp
#-*- coding:utf-8 -*-import urllib2,sysimport hashlib# Calculate a non-truncated Drupal 7 compatible password hash.# The consumer of these hashes must...
分类:数据库   时间:2015-01-02 15:58:37    阅读次数:287
判断素数
bool prime(long n){ for(long i=2;i<=sqrt(n);i++){ if(n%i== 0){ return false; } } return true;}复杂度O(n*sqrt(n))如想要...
分类:其他好文   时间:2015-01-01 08:58:33    阅读次数:122
Prime邻接表+优先队列
#include #include #include #include #include #include #include #include using namespace std;#define INF 0xfffffff#define maxn 103struct Edge{ int e...
分类:其他好文   时间:2014-12-31 15:59:29    阅读次数:147
LintCode-A+B Problem
For given numbers a and b in function aplusb, return the sum of them.NoteYou don't need to parse the input and output. Just calculate and return.Examp...
分类:其他好文   时间:2014-12-31 07:36:50    阅读次数:253
最小生成树--Kruskal算法
最小生成树   定义:n个顶点网络的生成树有n个结点,n-1条分枝。假设网络中有m条边(m≥n-1),用MST表示许多可能的生成树的集合,每棵树中n-1条分枝上的权之和用WG(T)表示,则使得WG(Tmin)=Min{WG(T)| T     MST}的生成树Tmin便是网络的最小生成树。   构造最小生成树的算法:Prime算法 和Kruskal算法     Kruskal算法...
分类:编程语言   时间:2014-12-29 13:49:54    阅读次数:191
最小生成树
最小生成树:n个顶点网络的生成树有n个结点,n-1条分枝。假设网络中有m条边(m≥n-1),用MST表示许多可能的生成树的集合,每棵树中n-1条分枝上的权之和用WG(T)表示,则使得WG(Tmin)=Min{WG(T)| T     MST}的生成树Tmin便是网络的最小生成树。   构造最小生成树的算法:Prime算法 和Kruskal算法         Prime算法 1....
分类:其他好文   时间:2014-12-29 13:47:36    阅读次数:257
poj1200 哈希
http://poj.org/problem?id=1200 Description Many people like to solve hard puzzles some of which may lead them to madness. One such puzzle could be finding a hidden prime number in a given text. ...
分类:其他好文   时间:2014-12-29 10:28:57    阅读次数:234
HDU 2056
Problem Description Given two rectangles and the coordinates of two points on the diagonals of each rectangle,you have to calculate the area of the intersected part of two rectangles. its sides are p...
分类:其他好文   时间:2014-12-29 09:07:51    阅读次数:155
bugkExercise 5.5 Calculating average student grades.
从输出结果来看,这个程序是错的。完全不知道什么意思。Exercise 5-5. Write a program that will calculate the average grade for the students ineach of an arbitrary number of classe...
分类:其他好文   时间:2014-12-28 19:28:10    阅读次数:164
Chose_Prime
素数筛选素数也叫质数,即只能被1和自己本身整除的数。在程序中,怎样筛选出在一定范围内中的素数呢?我们可以这样做:① 先从2开始找,然后删去这一范围中所有能被2整除的数。② 找到下一个没有被删去的数字n。③ 删去这一范围内中所有能整除n的数。④ 如果n*n>"范围最大值"就跳出,否则跳到第②步。代码:...
分类:其他好文   时间:2014-12-27 17:23:50    阅读次数:123
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!