码迷,mamicode.com
首页 >  
搜索关键字:can you dfs    ( 55632个结果
小黑的镇魂曲(HDU2155:贪心+dfs+奇葩解法)
题目:点这里题目的意思跟所谓的是英雄就下100层一个意思……在T秒内能够下到地面,就可以了(还有一个板与板之间不能超过H高)。接触这题目是在昨晚的训练赛,当时拍拍地打了个贪心+dfs,果断跟我想的一模一样,TLE了。赛后我在宿舍里修改了好几次……均无果。后来,我大胆地假设,估计是最后两组出问题TLE...
分类:其他好文   时间:2014-05-01 13:37:00    阅读次数:402
hdu 1179 最大匹配
题意:n个ren m个棍子 每个棍子可以与i个人结合 问最大有多少个结合#include#includeusing namespace std;int map[111][111];int fa[111];int v[111];int n,m;int dfs(int x){ for(int i=...
分类:其他好文   时间:2014-05-01 13:22:34    阅读次数:422
Leetcode:Minimum Path Sum 最小路径和
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path. Note: You can only move either down or right at...
分类:其他好文   时间:2014-04-28 10:46:41    阅读次数:311
CSU 1414: Query on a Tree
预处理每个结点的子结点的个数sons , 则对x的询问可由sons[x]- sigma( sons[v] ) (v是到x距离为d的点)得到 怎么快速的找到这些v呢? 注意到距离x为d的点肯定在树的同一层.... 可以对树进行dfs时记录每个结点时间戳的同时把每一层的结点保存下来,然后对每一层维护一个前缀和 如果v是x下面子结点那么v的时间戳肯定在x的范围内,这样就可以二分確定出前缀和的范围了....
分类:其他好文   时间:2014-04-28 10:34:42    阅读次数:434
Sdut 2409 The Best Seat in ACM Contest(山东省第三届ACM省赛 H 题)(模拟)
题目描述 Cainiao is a university student who loves ACM contest very much. It is a festival for him once when he attends ACM Asia Regional Contest because he always can find some famous ACMers there. C...
分类:其他好文   时间:2014-04-28 10:33:40    阅读次数:340
poj 3468 A Simple Problem with Integers
A Simple Problem with Integers Time Limit: 5000MS   Memory Limit: 131072K Total Submissions: 55626   Accepted: 16755 Case Time Limit: 2000MS Description You have N...
分类:其他好文   时间:2014-04-28 10:23:41    阅读次数:282
避免nrpe端进程监控多个接口
为了避免目标端nrpe进程监控多个接口而造成的安全漏洞。有必要固定服务端的地址,对nrpe.cfg配置中,有下列一行介绍 #SERVER ADDRESS # Address that nrpe should bind to in case there are more than one interface # and you do not want nrpe to bind on all in...
分类:其他好文   时间:2014-04-27 22:36:17    阅读次数:454
Hdfs的ACL测试
Hadoop从2.4.0版本开始支持hdfs的ACL,在CDH5.0当中也继承了该特性,下面对其进行一些测试: 一、启用ACL: dfs.permissions.enabled true dfs.namenode.acls.enabled true 二、测试ACL: ① [hadoop@master ~]$ groups hadoop 创建目录并上传文件: [...
分类:其他好文   时间:2014-04-27 21:18:00    阅读次数:306
mysql常用查询:group by,左连接,子查询,having where
前几天去了两个比较牛的互联网公司面试,在sql这块都遇到问题了,哎,可惜呀,先把简单的梳理一下 成绩表 score 1、group by 使用 按某一个维度进行分组 例如: 求每个同学的总分 SELECT student,SUM(score) FROM score GROUP BY student 求每个同学的平均分 SELECT student,AVG(score) FR...
分类:数据库   时间:2014-04-27 21:17:59    阅读次数:614
java Annotation原理
Annotations are one of the fundamental language changes introduced in Java SE5. They provide information that you need to fully describe your program, but that cannot be expressed in Java. Thus, anno...
分类:编程语言   时间:2014-04-27 21:14:59    阅读次数:431
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!