Islands
The first line of input contains two integers, that denote the value of V and E.
Each of the following E lines contains two integers, that denote that there exists an edge between vertex a and b.
Print the count the number of connected groups of islands
0 <= V <= 1000
0 <= E <= (V * (V-1)) / 2
0 <= a <= V - 1
0 <= b <= V - 1
Time Limit: 1 second
5 8
0 1
0 4
1 2
2 0
2 4
3 0
3 2
4 3
1
#include <iostream>using namespace std;
int main() { // Write your code here}
Comments
Post a Comment