2017ecjtu-summer training # 11 POJ 2492】的更多相关文章

A Bug's Life Time Limit: 10000MS   Memory Limit: 65536K Total Submissions: 38280   Accepted: 12452 Description Background Professor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they feature two different gender…
Communication System Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 29218   Accepted: 10408 Description We have received an order from Pizoor Communications Inc. for a special communication system. The system consists of several devices…
A Bug's Life Time Limit: 10000MS Memory Limit: 65536K Total Submissions: 28651 Accepted: 9331 Description Background Professor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they feature two different genders and…
G - A Bug's Life Time Limit:10000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Submit Status Practice POJ 2492 Appoint description: Description BackgroundProfessor Hopper is researching the sexual behavior of a rare species of bugs. H…
A Bug's Life POJ - 2492 Background Professor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they feature two different genders and that they only interact with bugs of the opposite gender. In his experiment, indi…
http://acm.hdu.edu.cn/showproblem.php?pid=1829 http://poj.org/problem?id=2492 臭虫有两种性别,并且只有异性相吸,给定n条臭虫(编号1-n)和m对关系,判断是否是出现同性恋的情况. 这题跟食物链的题类似,这里只有两种关系,关系是同性或者异性. 对于每只动物创建两个元素  同性或异性,并用这 2×n个元素建立并查集. 首先判断输入的x和y是否是一个组的.是就flag=1. 然后,如果x和y是一对,那么合并x和y+n,x+n…
http://poj.org/problem?id=2492 题意 :就是给你n条虫子,m对关系,每一对关系的双方都是异性的,让你找出有没有是同性恋的. 思路 :这个题跟POJ1703其实差不多,也是需要一个数组来存跟父亲节点的关系,需要两个集合来存是否有关系,在最后稍微变一下形就OK了. #include<iostream> #include<string.h> #include<stdio.h> #include<stdlib.h> using name…
题目;http://poj.org/problem?id=2492 卧槽很前卫的题意啊,感觉节操都碎了, t组测试数据,然后n,m,n条虫子,然后m行,每行两个数代表a和b有性行为(默认既然能这样就代表两者是异性),最后问的是 有没有同性恋, 比如a,b  b,c  a,c 第一组可以得到a和b是异性,第二组可以得到b和c是异性,因为只有两种性别,所以可以得出a和c一定是同性,但是第三组有表明a和c有性行为,赤裸裸的同性恋 所以输出 Suspicious bugs found! 和食物链哪题差不…
链接: http://poj.org/problem?id=2492 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=82830#problem/J 代码: #include<stdio.h> #include<string.h> #include<stdlib.h> #include<math.h> #include<algorithm> #include<iostream>…
题目链接:http://poj.org/problem?id=2492 题目大意:有n只虫子,m对关系,m行每行有x y两个编号的虫子,告诉你每对x和y都为异性,先说的是对的,如果后面给出关系与前面的矛盾则说明有同性的虫子在,判断是否有两只同性虫子被放在一起. 解题思路:大概算是简化版的食物链吧,可以认为只有两个种类,雄性和雌性,给出x和y说明x->y的偏移值为1(因为是异性),只要维护好权值数组val[]就行了.如果x,y还没有关系就放入并查集中,有关系的话就判断是否为异性. 代码: #inc…