B_xuanba
所属分类:软件设计/软件工程
开发工具:Visual C++
文件大小:6KB
下载次数:2
上传日期:2014-06-13 20:31:11
上 传 者:
wilber
说明: 第四届华为杯程序设计竞赛B题。问题输入
输入包括多个测试用例,首先给出测试用例数N,接着给出N个测试用例,1≤N≤100。
每一个测试用例包括M+1行,首先给出两个整数K和M;再依次给出M行,每行给出两个不同正整数i和j,表示两个不同亲友i和j属于同一亲友团,i≠j,1≤i≤K,1≤j≤K,,1≤K≤10000,1≤M≤10000。
问题输出
输出包括多行,对于每个测试用例,输出一行,给出至多需要划分出的独立区域数量。
样例输入
2
3 1
1 2
3 2
1 2
2 3
样例输出
2
1
(Problem input
Inputs include multiple test cases, test cases given first number N, then given N test cases, 1 ≤ N ≤ 100.
Each test includes M+1 rows, first give two integers K and M then in turn gives M lines, each given two different positive integers i and j, represent two different i and j belong to the same family and friends friends and relatives, i ≠ j, 1 ≤ i ≤ K, 1 ≤ j ≤ K,, 1 ≤ K ≤ 10000,1 ≤ M ≤ 10000.
Problem Output
The output includes a multi-line, for each test case, output a line, given the number of independent regional division of the most needed.
Sample Input
2
31
12
32
12
23
Sample Output
2
1)
文件列表:
B_xuanba.doc (24576, 2014-06-13)
近期下载者:
相关文件:
收藏者: