#include
#include
#include
using namespace std;
#define INFINITY DBL_MAX //无穷大
#define MAX_VERTEX_NUM 20 //最大顶点个数
enum GraphKind //图的类型
{
DG,DN,UDG,UDN//有向图、有向网、无向图、无向网
};
//弧结构
typedef struct...
分类:
其他好文 时间:
2014-06-07 01:52:18
阅读次数:
214
题目:
链接:点击打开链接
题意:
求需要修建的公路的最短长度。
算法:
思路:
prim最小生成树
代码:
#include
#include
#include
using namespace std;
#define MAX 100000000
#define MAXN 110
int map[MAXN][MAXN];
int ...
分类:
其他好文 时间:
2014-06-07 01:49:07
阅读次数:
213
Euler 14的不同解法 ----所涉及的知识 1. yield 2.BF 3. decorator 4.cache 5.等等
def euler_problem_14():
"""
最直接粗暴的解法:就是直接如下所示了
"""
max_count = 1
max_value = 1
for i in xrange(10010...
分类:
编程语言 时间:
2014-06-05 04:46:16
阅读次数:
266
解析程序自己的附加数据,将附加数据写入文件中。
主要是解析PE文件头,定位到overlay的地方,写入文件。常应用的场景是在crackme中,crackme自身有一段加密过的附加数据,在crackme运行的过程中解析自己的附加数据,然后解密这段数据。。。。
代码留存:
//解析自己的PE文件
TCHAR szModuleFile[MAX_PATH] = {0};
::GetMod...
分类:
其他好文 时间:
2014-06-05 03:01:16
阅读次数:
438
【前言】好久没写题解了,我还是写一下做题表格吧,如果有值得写的题目还是写一下。
【BZOJ1270】递推显然很简单。直接从高处和上面转移过来。
for (h=H;h;h--)
{
Max=0;
for (i=1;i<=n;i++)
Max=max(f[i][h+D],Max);
for (i=1;i<=n;i++)
f[i][h]=max...
分类:
其他好文 时间:
2014-06-05 00:30:21
阅读次数:
284
裸dijkstra
思路:以x为源点,求到其他点的最短路,之后把邻接矩阵转置,再求一次x源
点的最短路,这样就一次是来的,一次是走的,相加迭代最大值即可
代码:
/*
poj 3268
8108K 47MS
*/
#include
#include
#define MAXN 1005
#define MAX_INT 2147483647
using namespace s...
分类:
其他好文 时间:
2014-06-04 23:32:57
阅读次数:
303
int Largest(int list[], int length){ int i,max;
for(i = 0; i max) { max=list[i]; } } return max;}首先进行...
分类:
其他好文 时间:
2014-06-03 09:53:50
阅读次数:
267
使用echo或者printf时,可以添加输出文本的颜色设置echo -e "Maximum
\e[1;31m" $max_threads "\e[0mthreads allowed!" >>
$term_dir/summary或者printf("\033[;34mfile\033[0m")31开始代...
分类:
系统相关 时间:
2014-06-03 09:11:52
阅读次数:
306
原题地址:https://oj.leetcode.com/problems/max-points-on-a-line/题意:Givennpoints
on a 2D plane, find the maximum number of points that lie on the same strai...
分类:
编程语言 时间:
2014-06-03 08:55:48
阅读次数:
282
Givennpoints on a 2D plane, find the maximum
number of points that lie on the same straight line./** * Definition for a
point. * struct Point { * ...
分类:
其他好文 时间:
2014-05-30 16:27:19
阅读次数:
238