Find them, Catch them Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 38668 Accepted: 11905 Description The police office in Tadu City decides to say ends to the chaos, as launch actions to root up the TWO gangs in the city, Gang Drago…
并查集的经典题型,POJ上题目还是中文= =,一般看到中文题都会感觉不太简单,这道题的数学归纳用得比较多,可以简化代码,挺有意思的. 同类型的题目还有POJ1703,比这个要简单,想了解并查集基本介绍或想参考Code请移步:算法手记 之 数据结构(并查集详解)(POJ1703) 存在食物链: A吃B,B吃C,C吃A 给出两种判断:1 a b 指a和b相同 2 a b 指a吃b 现依照题目输入,输出判断的错误次数:1.a,b超过N错误 2.a,b不符合前面判断则错误 Code仅供参考: //食物链…
题目链接:http://poj.org/problem?id=2588 Snakes Time Limit: 1000MS Memory Limit: 65536K Description Buffalo Bill wishes to cross a 1000x1000 square field. A number of snakes are on the field at various positions, and each snake can strike a particular…