09 2014 档案

 
HDU 5047
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=5047直到看到题解,我才知道这道题考的是什么首先交点数是Σ(16*i),区域区分的公式是 边数+点数+1=分成的区域数,可以得到公式当然不知道那个公式也可以手算第三项,把前三项放到OEIS(http://oeis.... 阅读全文
posted @ 2014-09-29 19:46 LegendaryAC 阅读(613) 评论(0) 推荐(1)
HDU 5025
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=5025蛇最多只有五条,状态压缩一下,vis增加两维,表示取得钥匙的状态和蛇的状态,然后一个优先队列的bfs即可解决问题,简单题#include #include #include #include #include... 阅读全文
posted @ 2014-09-24 14:28 LegendaryAC 阅读(511) 评论(0) 推荐(0)
HDU 5040
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=5040题意比较难懂,有摄像头的位置是可以走的,每回合开始看做人先走摄像头再转,也就是说如果你这回合走之前没有摄像头在照你,走之后摄像头转过来被照,时间也只是+1,而不是+3(伪装是瞬间完成的)解法显而易见,一个优先... 阅读全文
posted @ 2014-09-23 14:18 LegendaryAC 阅读(368) 评论(0) 推荐(0)
HDU 5000
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=5000题意:有n种属性,每种属性的数值可以是0-T[i],当一个人属性全部小于等于另一个人的属性时,小的那个人会被淘汰,问最多同时存在多少人比赛的时候没有想到这题的关键点,没出来也是情理之中解法:sum表示一个人的... 阅读全文
posted @ 2014-09-23 13:17 LegendaryAC 阅读(760) 评论(0) 推荐(0)
HDU 5001
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=5001每次去掉要算的点,求出到达其他点的概率,就是不能到达这个点的概率开始想去算到达这个点的概率,再去减,不过这种方法证实是不对的,重复走的情况会重复计算#include #include #include #in... 阅读全文
posted @ 2014-09-14 09:33 LegendaryAC 阅读(595) 评论(0) 推荐(0)
HDU 4911
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4911一场多校的签到题,树状数组离散化求逆序数#include #include #include #include using namespace std ;typedef __int64 ll ;int n,k... 阅读全文
posted @ 2014-09-12 19:34 LegendaryAC 阅读(177) 评论(0) 推荐(0)
HDU 3605
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=3605用最大流做的,G++超时,C++可以过,看别人写的叫二分图多重匹配,还不会这玩意一会学学显然的最大流模型,n是100w,直接做最大流一定超时,但是注意到m只有10,所以可以对所有点进行状态压缩,状态相同的点可... 阅读全文
posted @ 2014-09-11 12:28 LegendaryAC 阅读(254) 评论(0) 推荐(0)
HDU 4704
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4704求(2^n)%mod的方法#include #include #include #include #include #include using namespace std ;//(2^n)%mod=(2^(... 阅读全文
posted @ 2014-09-10 20:25 LegendaryAC 阅读(188) 评论(0) 推荐(0)
ZOJ 3811
摘要:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5343网络赛这水题没写过太伤了,赛后写了下1A。当时钻牛角尖一定要用k次bfs,其实一次就够了,把扩展到的节点插入set中,复杂度nlogn#include #include #i... 阅读全文
posted @ 2014-09-10 10:44 LegendaryAC 阅读(178) 评论(0) 推荐(0)
HDU 4460
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4460水题一道,oj时间卡的非常奇怪,把spfa的queue开成全局卡线过,别的全挂了,迪杰斯特拉的手写堆都超时,可能是卡了map?#include #include #include #include #inc... 阅读全文
posted @ 2014-09-05 08:39 LegendaryAC 阅读(376) 评论(0) 推荐(0)
HDU 4462
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4462一道题意不清的水题题意:给一个n*n的格子,在上面放草人,每个草人有恐惧范围,问最少选择几个草人可以覆盖所有格子解法:草人个数只有10,暴力即可,dfs或者状压枚举。距离指的是曼哈顿距离,已经有草人的格子,不... 阅读全文
posted @ 2014-09-04 23:36 LegendaryAC 阅读(273) 评论(0) 推荐(0)
HDU 4927
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4927直接模拟会超时,要在纸上写写推公式A[n]*C(0,n-1) - A[n-1]*C(1,n-1) + A[n-2]*C(2,n-1) - A[n-3]*C(3,n-1) ...... A[1]*C(n-1,n... 阅读全文
posted @ 2014-09-03 05:07 LegendaryAC 阅读(131) 评论(0) 推荐(0)
HDU 4405
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4405题意:飞行棋,可以跳,从0走到n,问期望步数题解:dp[i]表示从i走到n的期望,逆推,因为每次都要走一步所以递推的时候每次加1这类期望问题的一个大致讲解:http://kicd.blog.163.com/b... 阅读全文
posted @ 2014-09-02 22:58 LegendaryAC 阅读(183) 评论(0) 推荐(0)
HDU 4986
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4986题意:n个钥匙放在n个箱子里,每个钥匙和箱子一一对应,求打开所有箱子的期望题解:题意:求随机排列的期望循环个数。分析:【引理 1】对于一个随机排列的某个元素,处在一个长度为 k 的循环中的概率为 1/n(与循... 阅读全文
posted @ 2014-09-02 19:34 LegendaryAC 阅读(227) 评论(0) 推荐(0)
HDU 4848
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4848题意:求遍历所有点的最小值(这个答案是加i点到起始点的距离,不是当前点到i的距离),必须在ti[i]前到达i点题解:暴搜,剪枝是((当前值>ans)&&(当前点到未到点的时间加上起点到当前点的时间大于未到点的... 阅读全文
posted @ 2014-09-02 02:39 LegendaryAC 阅读(560) 评论(0) 推荐(0)
HDU 4850
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4850西安邀请赛当时没做出来的银牌门坎题题意:构造一个长度n的字符串,长度>=4的子串只能出现一次题解:暴力枚举构造,复杂度是O(最长字符串长度*26),注意到最长字符串长度是26^4+3,因为长度为4的字符串共有... 阅读全文
posted @ 2014-09-02 01:20 LegendaryAC 阅读(423) 评论(0) 推荐(0)
HDU 1848
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1848利用计算grundy数组,把一类博弈转化为nim博弈,最后x不为0为先手必胜态#include #include #include #include #include using namespace std ... 阅读全文
posted @ 2014-09-01 01:50 LegendaryAC 阅读(403) 评论(0) 推荐(0)