文件名称:smoke
介绍说明--下载内容均来自于网络,请自行研究使用
★实验任务
现在初中生高中生竟然开始抽烟了,真是太不像话了,不过作为一个无奸不商的烟草商,
小白菜已经瞄准这块商机无限的市场了。他知道在某个学校里有 n(5 <= n <= 50000)个学
生,可人家毕竟是学生,直接询问他抽什么烟不太好,学生们也不愿意说,真烦躁。不过小
白菜想到了一个办法,就是每次抓两个人来询问是不是抽同一种烟。每次他都会记下回答是
yes 的两个学生,一共记了 q(2 <= q <= n*(n- 1)/2)对学生。现在小白菜捧着一大堆数据
来找你,他不需要知道每个人抽什么烟,只需要知道有几种烟能卖到这个学校,你能解决这
个难题吗?
★数据输入
每组数据的开头包含两个整形 n(5 <= n <= 50000)和 q(2 <= q <= n*(n- 1)/2),接下
来跟着 q 行,每行为两个学生的 ID。 ★数据输出
输出共有多少种的烟即可-The experimental task
Now the junior high school students should start smoking, it s really too bad, but as a no rape is not the tobacco business,
Chinese cabbage has been at this Shangji Wuxian market. He knows that there is n in a school (5 < n < = 50000) school
Students, they are students, directly asked him what smoking tobacco is not very good, the students are not willing to say, really upset. But small
Chinese thought of a way, is to catch every time two people to ask Is it right? Smoke the same tobacco. Every time he would write down the answer is
A total of two students of yes, wrote Q (2 < = q < = n* (n- 1) /2) for students. Now holding a lot of data of Chinese Cabbage
To find you, he does not need to know what each person smokes smoke, just need to know that there are several smoke can sell to the school, you can solve it
A problem?
Data input
At the beginning of each data contains two integer n (5 < n < = 50000) and Q (Q < 2 < = n* (n- 1) /2
现在初中生高中生竟然开始抽烟了,真是太不像话了,不过作为一个无奸不商的烟草商,
小白菜已经瞄准这块商机无限的市场了。他知道在某个学校里有 n(5 <= n <= 50000)个学
生,可人家毕竟是学生,直接询问他抽什么烟不太好,学生们也不愿意说,真烦躁。不过小
白菜想到了一个办法,就是每次抓两个人来询问是不是抽同一种烟。每次他都会记下回答是
yes 的两个学生,一共记了 q(2 <= q <= n*(n- 1)/2)对学生。现在小白菜捧着一大堆数据
来找你,他不需要知道每个人抽什么烟,只需要知道有几种烟能卖到这个学校,你能解决这
个难题吗?
★数据输入
每组数据的开头包含两个整形 n(5 <= n <= 50000)和 q(2 <= q <= n*(n- 1)/2),接下
来跟着 q 行,每行为两个学生的 ID。 ★数据输出
输出共有多少种的烟即可-The experimental task
Now the junior high school students should start smoking, it s really too bad, but as a no rape is not the tobacco business,
Chinese cabbage has been at this Shangji Wuxian market. He knows that there is n in a school (5 < n < = 50000) school
Students, they are students, directly asked him what smoking tobacco is not very good, the students are not willing to say, really upset. But small
Chinese thought of a way, is to catch every time two people to ask Is it right? Smoke the same tobacco. Every time he would write down the answer is
A total of two students of yes, wrote Q (2 < = q < = n* (n- 1) /2) for students. Now holding a lot of data of Chinese Cabbage
To find you, he does not need to know what each person smokes smoke, just need to know that there are several smoke can sell to the school, you can solve it
A problem?
Data input
At the beginning of each data contains two integer n (5 < n < = 50000) and Q (Q < 2 < = n* (n- 1) /2
(系统自动生成,下载前可以参看下载内容)
下载文件列表
smoke.txt