#-*- 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
#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
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
最小生成树
定义: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
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
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
从输出结果来看,这个程序是错的。完全不知道什么意思。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
素数筛选素数也叫质数,即只能被1和自己本身整除的数。在程序中,怎样筛选出在一定范围内中的素数呢?我们可以这样做:① 先从2开始找,然后删去这一范围中所有能被2整除的数。② 找到下一个没有被删去的数字n。③ 删去这一范围内中所有能整除n的数。④ 如果n*n>"范围最大值"就跳出,否则跳到第②步。代码:...
分类:
其他好文 时间:
2014-12-27 17:23:50
阅读次数:
123