Please subscribe to the official Codeforces channel in Telegram via the link ×

AbdAl-mateen's blog

By AbdAl-mateen, history, 4 years ago, In English

Hi? I'm struggling with this problem

I thought about this a lot, but still don't know where I messed!

Solution: 80961934

My approach was straight forward, for each element, e, I checked if there is a — e or b — e, if it's then I take the element the the appropriate group. Kind of DSU approach.


  • Vote: I like it
  • 0
  • Vote: I do not like it