ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1272. Non-Yekaterinburg Subway

Ready algorithm and all tests for lazy boys :)
Posted by D4nick 4 Nov 2020 21:19
http://e-maxx.ru/algo/connected_components
You need to output number of components minus 1.
Tests:

4 4 0
3 4
1 2
3 1
2 4
0


1 0 0
0

6 0 0
5

6 5 1
1 2
1 4
2 5
3 6
4 5
1 2
1

6 5 0
1 2
1 4
2 5
3 6
4 5
1

6 3 4
1 2
2 3
4 5
2

6 4 0
1 3
3 4
4 6
5 6
1

Edited by author 04.11.2020 21:20