上一页 1 2 3 4 5 6 7 8 ··· 47 下一页

2014年11月23日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1429经典的找钥匙开门走迷宫问题,把钥匙状态压缩一下,然后对迷宫bfs#include #include #include #include #include using namespace std;int n,m... 阅读全文
posted @ 2014-11-23 15:26 LegendaryAC 阅读(131) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1622白书上6.3.2二叉树层次遍历的例题,层次遍历用bfs,建立二叉树,很基础的题目#include #include #include #include #include using namespace std... 阅读全文
posted @ 2014-11-23 11:58 LegendaryAC 阅读(332) 评论(0) 推荐(0) 编辑

2014年11月22日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3335题意:在给出的n个数中找出一个集合,使得其中的数互不整除,求该集合最大的元素数量首先要对输入的数去重,输入的数是64位的,开始没用__int64坑了好久一上来我以为是求二分图最大独立集,利用相反的关系建边(整... 阅读全文
posted @ 2014-11-22 22:25 LegendaryAC 阅读(392) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4160大娃娃可以套在小娃娃外面(各边严格小),问最后最少得到几个娃娃题目中的娃娃可以看做点,嵌套关系可以看做有向的路径,这样发现这题就是一个裸的最小路径覆盖问题#include #include #include ... 阅读全文
posted @ 2014-11-22 21:02 LegendaryAC 阅读(208) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1350给m个顾客的乘车信息,表示几点前上车,要从一个坐标点到达另一个坐标点,花费的时间是两点的曼哈顿距离,两次换乘至少间隔1分钟(具体看样例),求最少的司机数目把每位顾客看成一个点,如果该司机可以在接完a顾客后接到... 阅读全文
posted @ 2014-11-22 20:38 LegendaryAC 阅读(281) 评论(0) 推荐(0) 编辑

2014年11月19日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5086求所有连续区间的数字和本质是一个乘法原理,当前位置的数字出现次数=这个数之前的数字个数*这个数之后的数字个数(均包括当前数字本身),注意i*(n-i+1)会超int#include #include #inc... 阅读全文
posted @ 2014-11-19 17:31 LegendaryAC 阅读(121) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1300这题大一就看到过,当时没读懂题目,今天再做就容易多了题意:升序给出n个珍珠的的数量和价值,问买这些珍珠的最小花费,其中可以用价值高的珍珠等量代替价值小的珍珠,并且一种价钱如果决定买,必须多买10个保底水dp,... 阅读全文
posted @ 2014-11-19 17:16 LegendaryAC 阅读(300) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3047和hdu 3038以及poj那个食物链一样,都是带权并查集,此题做法和hdu 3038完全相同,具体操作看上篇博客这题原来写过,但是没过,直接改的原来代码#include #include #include ... 阅读全文
posted @ 2014-11-19 15:34 LegendaryAC 阅读(246) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3038题意:[1-n]的区间,有m个询问,每个询问表示[a,b]的和是s,问一共有多少组矛盾sum[i]表示i到根节点的和,求区间和用sum[b]-sum[a-1]为方便描述先把a--我是把b的父亲接在a的父亲上,... 阅读全文
posted @ 2014-11-19 14:01 LegendaryAC 阅读(400) 评论(2) 推荐(1) 编辑

2014年11月18日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=5100用1*k方格覆盖n*n方格有趣的一道题,查了下发现m67的博客还说过这个问题其实就是两种摆法取个最大值1、横着摆放竖着补全,形成边长n%k的正方形2、在一个角摆成风车形(边长k+n%k),中间形成边长为k-n... 阅读全文
posted @ 2014-11-18 23:57 LegendaryAC 阅读(128) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 47 下一页