随笔分类 -  enjoy^ACM...

hdu 3669 Cross the Wall
摘要:Cross the WallTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 327680/327680 K (Java/Others) Total Submission(s): 2988 Accepted Submission(s): 527 Problem Description“Across the Great Wall, we can reach every corner in the world!” Now the citizens of Rectland want to cross the Great Wa... 阅读全文

posted @ 2012-04-18 16:46 sleeper_qp 阅读(888) 评论(0) 推荐(0)

fingting!!!总结1
摘要:第一次基本都是水题:还差一道搜索和"几何"第二次:hdu 1178推导公式:Sn=n*(n+1)*(n+2)/6;还有什么二分匹配(模板题),搜索(BFS,其实这道题目再难点就是欧拉路。。。)第三次:也基本都水题;hdu 1223可以说下,其实这是一道例题,好多讲DP的 都讲到了,提出了一种有序化处理数据然后再用DP计数;此题还有点就是大数;未完成的是一道圆与矩阵相切,搜索;第四次:水题与图论,并查集。。。tarjan的强连通分支最小生成树构树过程用到过hdu 1270枚举第五次:hdu 1409 DFA (话说最近出现两道了)hdu 1410 这道题目题目挺好,告诉了我一 阅读全文

posted @ 2012-03-24 10:57 sleeper_qp 阅读(170) 评论(0) 推荐(0)

poj 3714 最近点对 分治算法
摘要:最近点对_分治算法O(nlgn)思路:对所有点先按x不减排序, 二分x,得到点集S1,点集S2,通过递归求得S1,S2的最小点对距离d1,d2;D=min{d1,d2}; 合并S1,S2:找到在S1,S2划分线左右距离为D的所有点,按y不减(不增也可以)排序 循环每个点找它后面6个点的最小距离; 最后即求得最小点对距离。 若要求得点对坐标,在求值是保存点的坐标即可。最近点对还有随机算法 时间复杂度O(n)。RaidTime Limit: 5000MSMemory Limit: 65536KTotal Submissions: 3134Accepted: 1055DescriptionAfter 阅读全文

posted @ 2011-11-08 13:19 sleeper_qp 阅读(2635) 评论(0) 推荐(0)

poj 2751
摘要:首先给给出johnson算法。 对给定的任务进行如下排序: 分出序列A:s1[i]>=s1[j] 且以s1不减排序 序列B:s1[i]<s2[j] 且以s2不增排序 最优调度即为A+B 论文:http://wenku.baidu.com/view/dc34bbceda38376baf1fae52.htmlSaving EndeavourTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 931 Accepted: 531DescriptionSpace shuttle Endeavour (Endeavour is o 阅读全文

posted @ 2011-11-07 23:42 sleeper_qp 阅读(270) 评论(0) 推荐(0)

最短路径:Dijkstra——初探
摘要://算法:Dijkstra//主要思想(贪心):将图分为两部分:已确定离源点s最短距离的节点集合Q与未确定的集合P;//初始化:将dist[s]=0;visted[s]=1;//循环:在未确定集合P中寻找离源点最短距离的节点,并且然后对于其余未确定的节点进行松弛;//终止:visted中的所有元素均为1//算法正确性的简单证明(数学归纳)://1,当n=1时,即确定的集合中元素只有源点s时,显然是集合中的元素离源点都是最短的;//2,假设当n=k时即确定最短路径的集合中元素个数为k,结论正确;//那么n=k+1时即加入的第k+1个元素g是未确定最短路径的集合P中离源点最近的;//若此时dist 阅读全文

posted @ 2011-07-21 12:11 sleeper_qp 阅读(227) 评论(0) 推荐(0)

soj 2222 Health Power
摘要:2222 Health Powerxy likes playing TV games,these days there comes up aproblem,that is,as you know,in the game,he can get plenty offoods,which can add to the HP (Health Power) of the role, only whenthe HP grows full,it adds to the Score of the role, now he doesn'thow to maxium the Score of when f 阅读全文

posted @ 2011-07-21 12:10 sleeper_qp 阅读(338) 评论(0) 推荐(0)

soj 2749 The Fewest Coins
摘要:DescriptionFarmer John has gone to town to buy some farm supplies. Being a very efficient man, he always pays for his goods in such a way that the smallest number of coins changes hands, i.e., the number of coins he uses to pay plus the number of coins he receives in change is minimized. Help him to 阅读全文

posted @ 2011-07-21 12:09 sleeper_qp 阅读(442) 评论(0) 推荐(1)

poj 1837 很不错的题
摘要:BalanceTime Limit: 1000MSMemory Limit: 30000KTotal Submissions: 5258Accepted: 3120DescriptionGigel has a strange"balance" and he wants to poise it. Actually, the device isdifferent from any other ordinary balance.It orders two arms of negligible weight and each arm's length is15. Some 阅读全文

posted @ 2011-07-21 12:08 sleeper_qp 阅读(242) 评论(0) 推荐(0)

poj 2184 Cow Exhibition
摘要:Cow ExhibitionTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 5834Accepted: 1945Description"Fat and docile, bigand dumb, they look so stupid, they aren't muchfun..."- Cows with Guns by Dana LyonsThe cows want to prove to the public that they are both smart andfun. In order to 阅读全文

posted @ 2011-07-21 12:07 sleeper_qp 阅读(462) 评论(0) 推荐(0)

poj 2955 Brackets
摘要:BracketsTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 1734Accepted: 869DescriptionWe give the followinginductive definition of a “regular brackets” sequence:the empty sequence is a regular brackets sequence,if s is a regular brackets sequence, then (s) and[s] are regular brackets sequence 阅读全文

posted @ 2011-07-21 12:06 sleeper_qp 阅读(369) 评论(0) 推荐(0)

Ecust 406 sleeping at work
摘要:#include <stdio.h>#include <memory.h>int f[510][100],v[510][60];int a[510];int max(int a,int b){return a>b?a:b;}int add(int s,int b);int main(){ int n,k,m,j,i,T,g,maxx,temp; scanf("%d",&T); while(T--) { scanf("%d%d%d",&n,&m,&k); for(i=1;i<=n;i++) 阅读全文

posted @ 2011-07-21 12:04 sleeper_qp 阅读(221) 评论(0) 推荐(0)

导航