3296: [USACO2011 Open] Learning Languages Time Limit: 5 Sec  Memory Limit: 128 MBSubmit: 81  Solved: 39[Submit][Status] Description 农夫约翰的N(2 <= N<=10,000)头奶牛,编号为1.. N,一共会流利地使用M(1<= M <=30,000)种语言,编号从1 .. M.,第i头,会说K_i(1 <= K_i<= M)种语言,即L_…
Description 农夫约翰的N(2 <= N<=10,000)头奶牛,编号为1.. N,一共会流利地使用M(1<= M <=30,000)种语言,编号从1  .. M.,第i头,会说K_i(1 <= K_i<= M)种语言,即L_i1, L_i2,..., L_{iK_i} (1 <= L_ij <= M). FJ的奶牛 不太聪明,所以K_i的总和至多为100,000.两头牛,不能直接交流,除非它们都会讲某一门语言.然而,没有共同 语言的奶牛们,可以让…
http://www.lydsy.com/JudgeOnline/problem.php?id=3296 显然,每群能交流的群是个强联通块 然后求出scc的数量,答案就是scc-1 #include <cstdio> #include <cstring> #include <cmath> #include <string> #include <iostream> #include <algorithm> #include <qu…
题目链接:http://www.lydsy.com/JudgeOnline/problem.php?id=3296 题意: 农夫约翰的N(2 <= N <= 10,000)头奶牛,编号为1...N. 一共会流利地使用M(1<= M <=30,000)种语言,编号从1...M. 第i头,会说K_i(1 <= K_i <= M)种语言,即L_i1, L_i2,..., L_{iK_i} (1 <= L_ij <= M). FJ的奶牛不太聪明,所以K_i的总和至多…
http://www.lydsy.com/JudgeOnline/problem.php?id=3296 Time Limit: 5 Sec  Memory Limit: 128 MBSubmit: 254  Solved: 134[Submit][Status][Discuss] Description 农夫约翰的N(2 <= N<=10,000)头奶牛,编号为1.. N,一共会流利地使用M(1<= M <=30,000)种语言,编号从1 .. M.,第i头,会说K_i(1 &l…
Time Limit: 5 Sec Memory Limit: 128 MB Submit: 387 Solved: 206 [Submit][Status][Discuss] Description 农夫约翰的N(2 <= N<=10,000)头奶牛,编号为1.. N,一共会流利地使用M(1<= M <=30,000)种语言,编号从1 .. M.,第i头,会说K_i(1 <= K_i<= M)种语言,即L_i1, L_i2,-, L_{iK_i} (1 <= L…
3296: [USACO2011 Open] Learning Languages Time Limit: 5 Sec  Memory Limit: 128 MBSubmit: 436  Solved: 239[Submit][Status][Discuss] Description 农夫约翰的N(2 <= N<=10,000)头奶牛,编号为1.. N,一共会流利地使用M(1<= M <=30,000)种语言,编号从1  .. M.,第i头,会说K_i(1 <= K_i<…
A. Learning Languages time limit per test:2 seconds memory limit per test:256 megabytes The "BerCorp" company has got n employees. These employees can use m approved official languages for the formal correspondence. The languages are numbered wi…
A. Learning Languages time limit per test:2 seconds memory limit per test:256 megabytes input standard input output standard output The "BerCorp" company has got n employees. These employees can use m approved official languages for the formal c…
C. Learning Languages 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <cmath> 5 #include <algorithm> 6 #include <string> 7 #include <vector> 8 #include <stack> 9 #include <queue&…