随笔分类 -  ACM

摘要:http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=1446题意:你妹的,我妹的,他妹的,中文题啊,坑妹啊,中文题读错了。。。。。漏掉了条件了,返回的是如果浪子最终跳跃次数多于男爵的最终跳跃次数,只想骂自己,漏... 阅读全文
posted @ 2013-01-27 11:47 calmound 阅读(239) 评论(0) 推荐(0) 编辑
摘要:题意:n*n的矩阵放置不同的颜色(不同的数字代表不同的颜色),你有k次选择,每一次只能选择某一行或某一列,可以消除该行(列)的所有颜色,问有哪几种颜色,无论怎样经过k次选择后依然无法完全抹去。分析:依旧是将横坐标作为x集,纵坐标作为y集合进行匹配。对于某种颜色的匹配,如果他的最大匹配大于k,则该颜色... 阅读全文
posted @ 2013-01-25 14:23 calmound 阅读(323) 评论(0) 推荐(0) 编辑
摘要:第一次做到这种题目,虽然是中文题目,但是依旧不懂他的意思,直接上网搜了题解,然后自己想了下,豁然开朗,发现这种建图的方式真的很奇特,用x坐标匹配y坐标,这样x-y就是点(xi,yi)了,这是这道题建图的新颖之处。题意:中文题。。。。分析:循环删边,如果删除这条边后,他的最大匹配等于原最大匹配则... 阅读全文
posted @ 2013-01-25 11:30 calmound 阅读(543) 评论(0) 推荐(0) 编辑
摘要:刚开始题目看错了,一直wa,输入的坐标是浮点型。。。。。。。听了队友的,才知道prim算法只需要枚举到sqrt(n)就完全足够了,发现sqrt(n)好多地方用的到。View Code 1 #include 2 #include 3 4 const int MAXN=510; 5 const i... 阅读全文
posted @ 2013-01-24 12:10 calmound 阅读(170) 评论(0) 推荐(0) 编辑
摘要:看了discuss才真正明白这道题到底要让我们干什么,poj的discuss真心强大,通过这道题也明白了原来floyd除了找出任意两点的最短距离外,还有判断环的功能,强大!!!!题意:给出一系列数的大小关系,然后判断这些字母能否单一排序或者有几种排序方式,还是成环 这里注意的是,当第t个语... 阅读全文
posted @ 2013-01-24 11:51 calmound 阅读(199) 评论(0) 推荐(0) 编辑
摘要:Each year, fall in the North Central region is accompanied by the brilliant colors of the leaves on the trees, followed quickly by the falling leaves ... 阅读全文
posted @ 2012-10-30 16:43 calmound 阅读(389) 评论(0) 推荐(0) 编辑
摘要:StepsOne steps through integer points of the straight line. The length of a step must be nonnegative and can be by one bigger than, equal to, or by on... 阅读全文
posted @ 2012-08-28 15:52 calmound 阅读(179) 评论(0) 推荐(0) 编辑
摘要:The ? 1 ? 2 ? ... ? n = k problemThe problemGiven the following formula, one can set operators '+' or '-' instead of each '?', in order to obtain a gi... 阅读全文
posted @ 2012-08-28 13:50 calmound 阅读(275) 评论(0) 推荐(0) 编辑
摘要:Cube paintingWe have a machine for painting cubes. It is supplied with three different colors: blue, red and green. Each face of the cube gets one of ... 阅读全文
posted @ 2012-08-27 19:12 calmound 阅读(908) 评论(0) 推荐(0) 编辑
摘要:Anti-prime SequencesTime Limit:3000MSMemory Limit:30000KTotal Submissions:2175Accepted:1022DescriptionGiven a sequence of consecutive integers n,n+1,n... 阅读全文
posted @ 2012-08-23 13:29 calmound 阅读(669) 评论(0) 推荐(0) 编辑
摘要:Prime LandTime Limit:1000MSMemory Limit:10000KTotal Submissions:2122Accepted:979DescriptionEverybody in the Prime Land is using a prime base ... 阅读全文
posted @ 2012-08-22 20:40 calmound 阅读(431) 评论(0) 推荐(0) 编辑
摘要:A:该题写了很久,一直TLE,主要是枚举到n/2时间复杂度实在太高了,其实嘛,这道题就是因式分解,所以就是i*i=n,也就是sqrt(n)#include#includeint main(){ int n,T,i; int a,b; scanf("%d",&T); while... 阅读全文
posted @ 2012-08-22 09:48 calmound 阅读(572) 评论(0) 推荐(0) 编辑
摘要:DescriptionThe ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four... 阅读全文
posted @ 2012-08-19 16:41 calmound 阅读(288) 评论(0) 推荐(0) 编辑
摘要:题意:write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1。写一个程序找出一个是n的倍数且只包含0,1的m看了别人的代码,... 阅读全文
posted @ 2012-08-19 15:35 calmound 阅读(260) 评论(0) 推荐(0) 编辑
摘要:题意:判断图中的图形有几个集合。 这道题做的郁闷死我了,为了找开始字母的错误一个一个匹对。 这道题让我也懂得了表格的位置可以代表并查集的点,这样每个都不一样,而我想的那种用字母是否本身来判断有多少个集合是错误的,很明显一个字母不会只出现一次。而且在计算位置的时候也出错了,应该i*列代表的... 阅读全文
posted @ 2012-08-12 08:08 calmound 阅读(161) 评论(0) 推荐(0) 编辑
摘要:题意:判断两个图形是否相似,根据题意可以知道图形的分量,不是环就是链,所以我们只要依次两个图形是否一样就可以了分析:若两个图形完全一样的话,那么它们成环和成链的个数必定一样,当然成环(链)的点的个数也是一样的,所以我们可以忽视结点的本身, 而值注重这个点代表的意义就可以。一样的两图排序后,自然... 阅读全文
posted @ 2012-08-11 16:40 calmound 阅读(237) 评论(0) 推荐(0) 编辑
摘要:这是一道好题,让我又学了一个新的知识,离线算法+并查集题意:先给出图,求存在多少路径使得花费T小于L,T的定义是u,v亮点的所有路径的最大边的最小值(Unfortunately, making a pair of portals will cost min{T} energies. T in a p... 阅读全文
posted @ 2012-08-11 07:12 calmound 阅读(247) 评论(0) 推荐(0) 编辑
摘要:题意:给你一个点,然后给你这个点可达的点,注意这是双向图#includeconst int MAXN=30;const int INF=0x7fffffff;int map[MAXN][MAXN];int n,ans;int pre[MAXN];int dist[MAXN];void Prim(){... 阅读全文
posted @ 2012-08-08 14:16 calmound 阅读(217) 评论(0) 推荐(0) 编辑
摘要:水题,但是g++超时,c++对了 不解#includeconst int MAXN=505;const int INF=0x7fffffff;int xx[MAXN];int pre[MAXN];int map[MAXN][MAXN];int dist[MAXN];int ans,n,flag;vo... 阅读全文
posted @ 2012-08-08 13:26 calmound 阅读(363) 评论(0) 推荐(0) 编辑
摘要:这道题被坑的难受,很基础的题目,但是还是wa的郁闷,主要的错误是不懂的分析,导致变量的定义出错,记录k点的最短边要double的却依旧写int导致wa的找不出错了#include#include#includeconst int MAXN=1100;const int INF=0x7fffffff;... 阅读全文
posted @ 2012-08-08 10:23 calmound 阅读(347) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示