Skip to main content

Posts

Showing posts with the label Max Min

AtCoder Beginner Contest 247(E - Max Min)

  We think about  this   case : input: 10   8   1        2   1   8   3   1   8   9   1   8   2 Output: 14   Explanation:- 2 ( 1 )  1 ( 2 )  8 ( 3 )  3 ( 4 )  1 ( 5 )  8 ( 6 )  9 ( 7 )  1 ( 8 )  8 ( 9 )  6 ( 10 ) When we work on  2  then no pair added When we work on  1  then no pair added When we work on  8  then  2  pair added       1  to  3       2  to  3 When we work on  3  then  2  pair added       1  to  4       2  to  4 When we work on  1  then  3  pair added       ...