Codeforces Round 1133 (Div. 1, Div. 2) is coming soon! Register here. ×

Can not understand why get WA in test 1

Revision en2, by Philosophi, 2026-03-05 06:36:56

https://codeforces.me/contest/1726/submission/365331041 Can anyone tell me where did i do wrong in this solution ? thanks

Update: My answer in the first test can be drawn in a pic like this

If we remove blue we get 2 connected components, if we remove red we get 1 connected component. So in total we get 3, which is the same with the answer. Was my understanding wrong somewhere?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Philosophi 2026-03-05 06:36:56 342
en1 English Philosophi 2026-03-04 13:27:20 161 Initial revision (published)