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

Hint
Posted by coolboy19521 7 Aug 2024 13:23
It ain't a problem to include all the tunnels because apparently they have no cost. So include all of them and then count the number of connected components (let's call it l). The answer is not dependent to the bridges. It is just l-1.