How to solve problem D in codeforces global round 6 (1266D)

Revision en1, by bully....maguire, 2019-12-18 19:55:44

https://codeforces.me/contest/1266/problem/D

Editorial of the problem does not explains how to implement the solution .It only tells what conditions will hold after every operation and at the end (when optimal answer has been reached).

I read few submissions and they used set to solve the problem , for example : https://codeforces.me/contest/1266/submission/67106641

I will be very thankful if someone helps me to understand the solution .

Tags 1266d, #help

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English bully....maguire 2019-12-18 19:55:44 511 Initial revision (published)