题意:容易理解。分析:当n%(p+q)==0时,先取者必胜,必胜方案:先取q,然后对方去x个,先取者就取(p+q-x)个,最后对方就必须取玩p个,当n%(p+q)==r(rp&&r#include#includeint
main(){ int n, p, q; while(scanf("...
分类:
其他好文 时间:
2014-05-20 01:31:58
阅读次数:
233
http://acm.hdu.edu.cn/showproblem.php?pid=2112
1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #define maxn
6000 8 using nam...
分类:
其他好文 时间:
2014-05-20 00:38:27
阅读次数:
210
题意:一张n*m的网格内每个点有话费,还有若干个宝藏,问一个人要走进去拿走所有宝藏在走出来的最小花费。思路:看宝藏只有13个直接想到了状压dp[i][j]拿了哪几个前一个为j的最小花费,先bfs+优先队列预处理出最短路,然后记忆化搜索就可。代码如下:
1 /********************....
分类:
其他好文 时间:
2014-05-19 23:26:38
阅读次数:
352
题目描述Halloween is coming! So xiaoY has to prepare M
candies to treat the neighbor kids.When this horrible night come, There are N
little children ask x...
分类:
其他好文 时间:
2014-05-19 22:40:32
阅读次数:
412
最近在做毕设的收尾工作,很多程序都要部署到linux下来运行,遇到了挺多问题,昨天就集中性遇到了 在编译应用时,遇到了/usr/bin/ld: cannot
find -lxxx这种情况是系统找不到对应的库文件,其中,-lxxx表示链接库文件 libxxx.so。其命名规则是:lib+库名(即xxx...
分类:
其他好文 时间:
2014-05-19 21:30:52
阅读次数:
226
题目链接:HDU 2795 Billboard【题意】给你一张h*w(1 7 #include
8 #include 9 using namespace std;10 const int MAX = 200005;11 12 int tree[MAX=
val)26 {27 ...
分类:
其他好文 时间:
2014-05-19 10:09:17
阅读次数:
419
题目链接:HDU 1394 Minimum Inversion
Number【题意】给你一个1~N的数字组成的初始序列,然后每一次都将第一个数字移到最后,形成新的序列,然后求出这些序列的逆序数中的最小值。【思路】开始可以用任意一种方法(线段树
or 暴力 or 树状数组)计算出初始数列的逆序数sum...
分类:
其他好文 时间:
2014-05-19 09:50:31
阅读次数:
282
服务器socketstreamtcpc原贴地址:http://topic.csdn.net/u/20090103/16/a0414edb-b289-4c72-84da-39e155e8f4be.html如下演示程序,程序目的是:先准备好一个ServerSocket,监听端口8880,然后建一个Cl....
分类:
其他好文 时间:
2014-05-17 15:08:29
阅读次数:
666
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2544题目意思:给出 n 个路口和 m 条路,每一条路需要 c
分钟走过。问从路口 1 到路口 n 需要的最短时间是多少。 这题是最短路的入门题,从理解d-i--j---k(wg自创的,呵呵)到默打到.....
分类:
其他好文 时间:
2014-05-17 14:48:32
阅读次数:
212
1.Scatter/Gather I/Oa single system call to
read or write data between single data stream and multiple buffersThis type of
I/O is so named because the...
分类:
系统相关 时间:
2014-05-17 14:17:55
阅读次数:
571