help with a question in a recent contest at CODECHEF JUNE Lunchtime 2020

Revision en2, by rishi7, 2020-06-29 19:44:23

problem: https://www.codechef.com/LTIME85A/problems/COWSHEDS

I was able to solve it when the constraints are less, how to solve it efficiently? Editorial for this question hasn't been released yet. So, it would be of great help if you could explain your approach and key concepts along with the solution.

Tags #dsu, #codechef

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English rishi7 2020-06-29 19:44:23 162
en1 English rishi7 2020-06-29 19:42:28 219 Initial revision (published)