码迷,mamicode.com
首页 >  
搜索关键字:poj 2007 scrambled p    ( 20315个结果
poj 2195 Going Home
1 /* 2 做网络流的题建图真的是太重要了! 3 本题是将人所在的位置和房子所在的位置建立边的联系,其中man到house这一条边的流量为 1, 费用为两者的距离 4 而方向边的流量为 0, 费用为正向边的相反数(也就是沿着反向边进行增广时,费用要减少,更改先前错误的选...
分类:其他好文   时间:2014-06-27 20:08:40    阅读次数:260
【POJ】1451 T9
DFS+字典树。 1 #include 2 #include 3 #include 4 5 typedef struct Trie { 6 int v; 7 Trie *next[26]; 8 } Trie; 9 10 Trie root; 11 int ...
分类:其他好文   时间:2014-06-27 14:32:44    阅读次数:183
【POJ】2503 Babelfish
字典树简单题。 1 #include 2 #include 3 #include 4 5 typedef struct Trie { 6 Trie *next[26]; 7 char str[15]; 8 } Trie; 9 10 Trie root;11 12 void c...
分类:其他好文   时间:2014-06-27 11:32:27    阅读次数:172
POJ #1050 - To the Max
Looks quite intuitive at the very first sight... I thought:rect[x, y, w+1, h+1] = rect[x, y, w, h] + num[x + w + 1, y..y+h+1] + num[x..x+w+1, y+h+1] -...
分类:其他好文   时间:2014-06-26 21:20:32    阅读次数:232
poj 3903 Stock Exchange(最长上升子序列,模版题)
题目#include//最长上升子序列 nlogn//入口参数:数组名+数组长度,类型不限,结构体类型可以通过重载运算符实现//数组下标从1号开始。int bsearch(int a[],int len,int num){ int left=1,right=len; while(left...
分类:其他好文   时间:2014-06-26 16:20:12    阅读次数:236
POJ 3253 Fence Repair(优先队列,哈夫曼树)
题目//做哈夫曼树时,可以用优先队列(误?)//这道题教我们优先队列的一个用法:取前n个数(最大的或者最小的)//哈夫曼树//64位//超时->优先队列,,,,//这道题的优先队列用于取前2个小的元素#include #include#include#include#includeusing nam...
分类:其他好文   时间:2014-06-26 16:01:24    阅读次数:215
HDU 3623 Best Cow Line, Gold(模拟,注意思路,简单)
题目POJ 3617 和 这道题题目一样,只是范围稍稍再小一点。//模拟试试#include#include#includeusing namespace std;char s[30010][2];bool bijiao(int st,int ed){ if(st==ed) re...
分类:其他好文   时间:2014-06-26 16:00:00    阅读次数:201
poj3617 Best Cow Line
POJ3617 Best Cow Line...
分类:其他好文   时间:2014-06-26 13:36:14    阅读次数:206
POJ 1041 John's trip Euler欧拉回路判定和求回路
就是欧拉判定,判定之后就可以使用DFS求欧拉回路了。图论内容。 这里使用邻接矩阵会快很多速度。 这类题目都是十分困难的,光是定义的记录的数组变量就会是一大堆。 #include #include #include #include using namespace std; struct Edge { int ed, des; Edge(int e = 0, int d ...
分类:其他好文   时间:2014-06-26 13:16:05    阅读次数:250
POJ 2151 Check the difficulty of problems (动态规划-概率DP)
POJ 2151 Check the difficulty of problems (动态规划-概率DP) 题目大意: 有 M 道题目 T 支队伍,N表示 最好 的队 至少要做出N题 ,紧接下来T行M列,表示某队做出某题 的概率为p ,问你每支队至少做出1题,最好的队至少做出N题的概率是多少? 解题思路: 一题动态规划的题, 既然最好的队至少做出N题,那么用二维记录,DP [t][f] 记录还剩 t 支队及是否出现超过N题的事件的概率。如果当前这支队伍做出超过N题,那么f置为1,否则还是f。弹了两遍,...
分类:其他好文   时间:2014-06-26 07:11:03    阅读次数:190
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!