Is my Approad wrong?

Правка en1, от TTMMM, 2019-12-10 14:09:57

Submission ID: 66585414 Problem : 1201/C C. Maximum Median

I am first calculating that for median to be ar[i], can we go there by swapping? Once done, all elements in second half of array are equal and i am still left with k, its easy to increase median by increasing all elements by 1 each. Please tell if this approach is fine or not, Getting WA at test case 6

Теги median, #binary search, #greedy, #implementation, 1500, #constructive algorithms

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский TTMMM 2019-12-10 14:10:24 3
en1 Английский TTMMM 2019-12-10 14:09:57 390 Initial revision (published)