码迷,mamicode.com
首页 >  
搜索关键字:poj bfs    ( 24949个结果
[leetcode]Binary Tree Level Order Traversal @ Python
原题地址:http://oj.leetcode.com/problems/binary-tree-level-order-traversal/题意:二叉树的层序遍历的实现。解题思路:二叉树的层序遍历可以用bfs或者dfs来实现。这里使用的dfs实现,代码比较简洁。实际上,二叉树的先序遍历就是dfs实...
分类:编程语言   时间:2014-05-14 03:25:59    阅读次数:428
POJ 2262 Goldbach's Conjecture
POj 2262 Goldbach's Conjecture...
分类:数据库   时间:2014-05-13 23:48:45    阅读次数:511
POJ 3278 Catch That Cow
POJ 3278 Catch That Cow...
分类:其他好文   时间:2014-05-13 08:23:36    阅读次数:328
POJ 3321 DFS序+线段树
单点修改树中某个节点,查询子树的性质.DFS序 子树序列一定在父节点的DFS序列之内,所以可以用线段树维护. 1: /* 2: DFS序 +线段树 3: */ 4: 5: #include 6: #include 7: #include 8: #include 9: #include 10: #in...
分类:其他好文   时间:2014-05-12 20:15:56    阅读次数:317
poj 2586 Y2K Accounting Bug (贪心)
Y2K Accounting BugTime Limit:1000MSMemory Limit:65536KTotal Submissions:9632Accepted:4806DescriptionAccounting for Computer Machinists (ACM) has suffe...
分类:其他好文   时间:2014-05-12 19:47:15    阅读次数:462
POJ 1862 Stripies 贪心+优先队列
有一种生物能两两合并,合并之前的重量分别为m1和m2,合并之后变为2*sqrt(m1*m2),现在给定n个这样的生物,求合并成一个的最小重量...
分类:其他好文   时间:2014-05-12 06:32:12    阅读次数:239
[字典树] poj 2418 Hardwood Species
题目链接: http://poj.org/problem?id=2418 Hardwood Species Time Limit: 10000MS   Memory Limit: 65536K Total Submissions: 17511   Accepted: 6949 Description Har...
分类:其他好文   时间:2014-05-11 21:24:17    阅读次数:387
POJ 2002 点的hash
Squares Time Limit: 3500MS   Memory Limit: 65536K Total Submissions: 15489   Accepted: 5864 Description A square is a 4-sided polygon whose sides have equal length and adja...
分类:其他好文   时间:2014-05-11 20:56:36    阅读次数:416
POJ 3468 A Simple Problem with Integers(线段树)
题目链接:http://poj.org/problem?id=3468 A Simple Problem with Integers Time Limit: 5000MS   Memory Limit: 131072K Total Submissions: 56005   Accepted: 16903 Case Time Limit...
分类:其他好文   时间:2014-05-11 18:40:16    阅读次数:301
poj 2456 二分法 最大化最小值
题目:http://poj.org/problem?id=2456 重新练习下二分法,发现还是手速不够 从这道题学到一下几点: 1、线性分几段的方法,看我的Judge()代码; 2、二分的while()最终打印的是down,而不是mid(我代码里写的是ans),或者up, 这么想:跳出循环的时候,假设while里的判断,Judge(ans)==1,那么down是正确解,up不是 Jud...
分类:其他好文   时间:2014-05-11 03:39:07    阅读次数:278
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!