关于bug的搜索的问题,用C语言的实现方式

Problem Description
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, individual bugs and their interactions were easy to identify, because numbers were printed on their backs.

Problem
Given a list of bug interactions, decide whether the experiment supports his assumption of two genders with no homosexual bugs or if it contains some bug interactions that falsify it.

Input
The first line of the input contains the number of scenarios. Each scenario starts with one line giving the number of bugs (at least one, and up to 2000) and the number of interactions (up to 1000000) separated by a single space. In the following lines, each interaction is given in the form of two distinct bug numbers separated by a single space. Bugs are numbered consecutively starting from one.

Output
The output for every scenario is a line containing "Scenario #i:", where i is the number of the scenario starting at 1, followed by one line saying either "No suspicious bugs found!" if the experiment is consistent with his assumption about the bugs' sexual behavior, or "Suspicious bugs found!" if Professor Hopper's assumption is definitely wrong.

Sample Input
2
3 3
1 2
2 3
1 3
4 2
1 2
3 4

Sample Output
Scenario #1:
Suspicious bugs found!

Scenario #2:
No suspicious bugs found!

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问

相似问题

1
C语言小游戏多次循环偶尔几次会出bug,求解?
0
二分搜索方面的一个复习试题,感觉比较困难,怎么利用 C 语言的办法和方式解决
1
C语言贪吃蛇总是莫名奇妙卡住,我应该如何调试?
0
关于堆栈知识点的运用,如何解决这个序列出入分配,采用C语言的实现
1
gdb调试任何C语言代码都报错:not in executable format: File format not recognized
2
C++的string头文件有时在使用时会遇到一些罕见的bug,这些bug是什么?
1
圆圈和线段在坐标系上的计算,怎么采用C语言的程序的代码的编写的功能加以实现?
0
数据完整性的校验的问题,怎么利用C语言的程序编写过程的办法用程序编写的方式完成
0
排除日期计算的一个bug的算法,怎么利用C语言的程序编写出来的代码的过程的思想方法去做
1
下面用javascript实现的缓冲运动效果,是否存在让运动物体越过目标位置的bug?
4
手机端web网站一个很神奇的bug求助。关于按钮的click事件执行的问题。
0
计算软件的打补丁的计算的问题,怎么才能使用C语言的程序的设计的编写的过程的方式来解决的办法
0
圆和直线线段的焦点和相切,怎么使用C语言的程序的代码编写的办法有效地实现的过程是什么
0
一个统筹的算法的计算的问题,怎么使用C语言的程序的代码编写过程的实现怎么来做
0
计算软件的打补丁的计算的问题,怎么才能使用C语言的程序的设计的编写的过程的方式
0
计算圆形和线段的切线的问题,要求是使用C语言的程序的代码设计的编写的过程如何加以实现的呢
1
发现安卓的动画功能有一个大BUG
0
A Bug's Life,C编程题
0
C语言,It's not a Bug, It's a Feature!
0
C语言 A Bug's Life