锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久嫩草精品久久久精品一,国产精品免费网站在线观看,国产自产2019最新不卡http://www.shnenglu.com/Ylemzy/articles/103103.html鐏⒊榛?/dc:creator>鐏⒊榛?/author>Sun, 13 Dec 2009 06:31:00 GMThttp://www.shnenglu.com/Ylemzy/articles/103103.htmlThe Suspects

Description

Severe acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global threat in mid-March 2003. To minimize transmission to others, the best strategy is to separate the suspects from others.
In the Not-Spreading-Your-Sickness University (NSYSU), there are many student groups. Students in the same group intercommunicate with each other frequently, and a student may join several groups. To prevent the possible transmissions of SARS, the NSYSU collects the member lists of all student groups, and makes the following rule in their standard operation procedure (SOP).
Once a member in a group is a suspect, all members in the group are suspects.
However, they find that it is not easy to identify all the suspects when a student is recognized as a suspect. Your job is to write a program which finds all the suspects.

Input

The input file contains several cases. Each test case begins with two integers n and m in a line, where n is the number of students, and m is the number of groups. You may assume that 0 < n <= 30000 and 0 <= m <= 500. Every student is numbered by a unique integer between 0 and n鈭?, and initially student 0 is recognized as a suspect in all the cases. This line is followed by m member lists of the groups, one line per group. Each line begins with an integer k by itself representing the number of members in the group. Following the number of members, there are k integers representing the students in this group. All the integers in a line are separated by at least one space.
A case with n = 0 and m = 0 indicates the end of the input, and need not be processed.

Output

For each case, output the number of suspects in one line.

Sample Input

100 4
2 1 2
5 10 13 11 12 14
2 0 1
2 99 2
200 2
1 5
5 1 2 3 4 5
1 0
0 0

Sample Output

4
1
1
棰樻剰錛?/span>
緇欏嚭浜烘暟n鍜屼漢鏁伴噷鐨勪漢緹ゆ暟m錛屽悓涓兢鐨勪漢灞炰簬涓涓泦鍚堛傛眰涓庣紪鍙?鐨勪漢鍚屼釜闆嗗悎鐨勪漢鏁幫紙鍖呮嫭0鏈韓)

浠g爜鍏ヤ笅錛?br />
#include<stdio.h>
#define聽maxn聽30000
int聽father[maxn];
void聽setFather(int聽n)
{
聽聽聽聽
for聽(int聽i聽=0;聽i聽<聽n;聽i++)
聽聽聽聽{
聽聽聽聽聽聽聽聽father[i]聽
=-1;
聽聽聽聽}
}
int聽find(int聽a)
{
聽聽聽聽
if聽(father[a]聽<0)
聽聽聽聽{
聽聽聽聽聽聽聽聽
return聽a;
聽聽聽聽}
聽聽聽聽
return聽father[a]聽=聽find(father[a]);
}
void聽Union(int聽a,聽int聽b)
{
聽聽聽聽a聽
=聽find(a),聽b聽=聽find(b);
聽聽聽聽
if聽(a聽!=聽b)
聽聽聽聽{
聽聽聽聽聽聽聽聽
if聽(father[a]聽<聽father[b])
聽聽聽聽聽聽聽聽{
聽聽聽聽聽聽聽聽聽聽聽聽father[a]聽
+=聽father[b];
聽聽聽聽聽聽聽聽聽聽聽聽father[b]聽
=聽a;
聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽
else
聽聽聽聽聽聽聽聽{
聽聽聽聽聽聽聽聽聽聽聽聽father[b]聽
+=聽father[a];
聽聽聽聽聽聽聽聽聽聽聽聽father[a]聽
=聽b;
聽聽聽聽聽聽聽聽}
聽聽聽聽}
}
int聽main()
{
聽聽聽聽
int聽i,聽j,聽n,聽m,聽a,聽b,聽v,聽t;
聽聽聽聽
while聽(1)
聽聽聽聽{
聽聽聽聽聽聽聽聽scanf(
"%d%d",聽&n,聽&m);
聽聽聽聽聽聽聽聽
if聽(n聽==0&&聽m聽==0)
聽聽聽聽聽聽聽聽{
聽聽聽聽聽聽聽聽聽聽聽聽
break;
聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽setFather(n);
聽聽聽聽聽聽聽聽
for聽(i聽=0;聽i聽<聽m;聽i++)
聽聽聽聽聽聽聽聽{
聽聽聽聽聽聽聽聽聽聽聽聽scanf(
"%d%d",聽&v,聽&a);
聽聽聽聽聽聽聽聽聽聽聽聽
for聽(j聽=1;聽j聽<聽v;聽j++)
聽聽聽聽聽聽聽聽聽聽聽聽{
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽scanf(
"%d",聽&b);
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽Union(a,聽b);
聽聽聽聽聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽printf(
"%d\n",聽father[find(0)]聽*聽(-1));
聽聽聽聽}
聽聽聽聽
return0;
}




]]>
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            亚洲欧美日韩国产一区| 美女图片一区二区| 欧美日韩免费看| 亚洲每日更新| 亚洲精品日韩一| 欧美午夜一区二区| 一区二区三区四区五区在线| 日韩午夜av| 国产日韩欧美在线视频观看| 麻豆成人在线| 欧美成人一区二区三区| 亚洲一区免费网站| 亚洲一区二区三区免费在线观看 | 久久一综合视频| 蜜桃av综合| 亚洲综合导航| 久久久久青草大香线综合精品| 91久久在线观看| 亚洲精品欧美日韩| 国产精品任我爽爆在线播放| 亚洲开发第一视频在线播放| 亚洲一区二区三区777| 国自产拍偷拍福利精品免费一| 欧美激情91| 国产精品亚洲综合一区在线观看| 蜜臀va亚洲va欧美va天堂 | 亚洲永久在线观看| 亚洲国产欧美一区二区三区同亚洲 | 欧美日本一区二区高清播放视频| 欧美在线观看视频| 久久综合一区| 亚洲欧美日韩高清| 欧美福利电影在线观看| 久久精品一区二区三区中文字幕| 美女在线一区二区| 欧美诱惑福利视频| 欧美日韩一区二区在线| 狼人天天伊人久久| 国产麻豆精品久久一二三| 欧美福利视频一区| 国产日韩欧美一二三区| 99在线|亚洲一区二区| 最新日韩中文字幕| 久久久久久久综合色一本| 亚洲免费视频成人| 欧美日韩高清在线播放| 欧美成人一区二区三区片免费| 国产农村妇女精品一二区| 国产精品高潮呻吟久久| 国产亚洲一区二区三区| 国产欧美日韩亚州综合| 一区二区三区欧美亚洲| 日韩视频一区二区在线观看 | 欧美成人精品一区二区| 国产亚洲免费的视频看| 亚洲欧美日韩精品久久亚洲区| 日韩视频一区二区| 欧美久久久久久蜜桃| 亚洲高清激情| 欧美性片在线观看| 一本大道久久精品懂色aⅴ| 最新中文字幕亚洲| 久久综合网hezyo| 欧美成人精品在线观看| 国外视频精品毛片| 久久激情五月婷婷| 欧美www在线| 亚洲精品久久久久中文字幕欢迎你 | 久久国产综合精品| 国产情侣一区| 午夜综合激情| 久久久亚洲人| 亚洲国产三级在线| 欧美高清在线视频| 99视频精品在线| 亚洲女性裸体视频| 国产精品人人做人人爽人人添| 亚洲一区免费| 麻豆精品在线播放| 亚洲大胆人体视频| 欧美激情va永久在线播放| 亚洲日本一区二区三区| 亚洲小说欧美另类婷婷| 欧美性jizz18性欧美| 午夜久久久久久| 欧美成人a∨高清免费观看| 亚洲免费观看视频| 国产精品女人网站| 久久蜜桃资源一区二区老牛 | 亚洲天堂av高清| 国产美女精品视频免费观看| 久久久久成人精品免费播放动漫| 欧美寡妇偷汉性猛交| 中文精品视频一区二区在线观看| 国产精品美女久久久久aⅴ国产馆| 午夜精品免费| 亚洲黄色有码视频| 亚洲午夜免费福利视频| 国产视频在线观看一区二区| 欧美不卡一区| 亚洲欧美国产不卡| 欧美成人激情在线| 免费日韩一区二区| 99伊人成综合| 欧美激情91| 久久国产精品一区二区三区四区| 亚洲黄色影院| 国产欧美日韩亚洲| 欧美精品一区二区高清在线观看| 9色国产精品| 欧美成人午夜影院| 欧美影院成人| 国产精品99久久久久久宅男 | 在线视频亚洲欧美| 亚洲国产日韩精品| 国产精品久久久久一区二区三区| 久久精品视频va| 亚洲调教视频在线观看| 欧美aa在线视频| 亚洲欧美日韩成人| 99热在这里有精品免费| 韩国欧美一区| 国产欧美精品一区aⅴ影院| 蜜桃av久久久亚洲精品| 久久精品国产一区二区三| 亚洲社区在线观看| 亚洲美女毛片| 亚洲日韩视频| 欧美成人精精品一区二区频| 久久久亚洲成人| 香蕉免费一区二区三区在线观看| 亚洲精品久久久久久久久久久| 亚洲电影av在线| 国内自拍亚洲| 黑丝一区二区三区| 黄色成人免费网站| 国内欧美视频一区二区| 国产亚洲人成a一在线v站| 国产精品欧美久久久久无广告| 欧美精品在线一区| 能在线观看的日韩av| 毛片基地黄久久久久久天堂| 久久乐国产精品| 久久夜色精品亚洲噜噜国产mv | 亚洲国产视频直播| 亚洲国产一区二区三区a毛片| 欧美国产精品劲爆| 亚洲国产成人久久综合一区| 欧美激情在线播放| 亚洲日本va午夜在线影院| 亚洲欧洲视频| 一本色道久久综合亚洲精品不 | 欧美一区亚洲| 国精品一区二区| 免费观看亚洲视频大全| 免费在线国产精品| 欧美另类变人与禽xxxxx| 欧美午夜精彩| 国产一本一道久久香蕉| 在线观看欧美一区| av成人免费| 亚洲在线免费观看| 久久久五月天| 亚洲激情在线激情| 亚洲影院免费观看| 久久噜噜噜精品国产亚洲综合| 麻豆国产精品va在线观看不卡| 欧美日韩 国产精品| 国产精品亚洲美女av网站| 国内久久精品| 一区二区高清视频| 欧美伊久线香蕉线新在线| 美女在线一区二区| 夜夜夜精品看看| 久久精品一二三区| 欧美色精品在线视频| 国产婷婷色一区二区三区四区| 在线成人中文字幕| 亚洲在线黄色| 欧美激情va永久在线播放| 在线视频你懂得一区| 久久网站热最新地址| 欧美日韩综合一区| **欧美日韩vr在线| 午夜一区二区三区不卡视频| 欧美激情a∨在线视频播放| 亚洲欧美久久久| 美女精品视频一区| 国产视频亚洲精品| 一本色道久久综合精品竹菊 | 西西人体一区二区| 欧美成人免费在线视频| 国产欧美日韩视频| 一本色道久久88综合亚洲精品ⅰ | 欧美激情亚洲| 亚洲女女女同性video| 欧美美女bb生活片| 亚洲第一视频网站| 久久成人精品无人区| 99热在线精品观看|