摘要: 昨天搜水题做,一不小心进一牛人的博客,看到几道二分题的报告,忍不住做了一下,顺便把人家对题目的描述偷懒过来,说我邪恶吧( ⊙ o ⊙ )!POJ 3258 River Hopscotchhttp://poj.org/problem?id=3258长为L的河道,起点在0位置,终点为L位置,期间分布着n块石头,石头不会重叠求拆掉其中的m块石头,使相邻两石头间的距离的最小值最大,并输出这个值。。。额。。。貌似描述不清。。。将就一下,(*^__^*) 嘻嘻……View Code #include#include#includeusingnamespace std;constint N =50000+1 阅读全文
posted @ 2011-03-13 19:55 AndreMouche 阅读(708) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2362POJ 2362 Sqare大意: 有n根木棒,长短不一,问能否使用所有的木棒摆出一个完整的正方形?分析:1.木棒的总长度整除42.DFSView Code #include#includeconstint N =22;int sticks[N];bool visited[N];int part;int n;//从start根木棒出发,在已经凑齐pnum条边,//第pnum+1条边已有pre长度的情况下,搜索是否存在满足答案的解bool search(int start,int pnum,int pre){ if(pnum==3&am 阅读全文
posted @ 2011-03-13 19:47 AndreMouche 阅读(443) 评论(0) 推荐(0) 编辑