摘要: 食物链Time Limit: 1000MSMemory Limit: 10000KTotal Submissions: 30510Accepted: 8883Description动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编... 阅读全文
posted @ 2012-08-09 22:43 max_xbw 阅读(198) 评论(0) 推荐(0)
摘要: A Bug's LifeTime Limit: 10000MSMemory Limit: 65536KTotal Submissions: 21679Accepted: 7071DescriptionBackground Professor Hopper is researching the sex... 阅读全文
posted @ 2012-08-09 20:46 max_xbw 阅读(332) 评论(0) 推荐(0)
摘要: 最近有学到一种更加通用的方法,因为它还适用于1182食物链中有三种集合相关联的情况,而且此法更为简洁。只需加一个rank数组,表示两种派别,值为0和1,初始化为0.查询时如果两人属于同一集合并且属于派别相同就输出In the same gang.否则输出In different gangs.不属于同... 阅读全文
posted @ 2012-08-09 12:10 max_xbw 阅读(149) 评论(0) 推荐(0)
摘要: Ubiquitous ReligionsTime Limit: 5000MSMemory Limit: 65536KTotal Submissions: 17762Accepted: 8653DescriptionThere are so many different religions in th... 阅读全文
posted @ 2012-08-09 10:55 max_xbw 阅读(270) 评论(0) 推荐(0)