Solution for Equal Average Codechef

Правка en1, от vivekcrux, 2019-09-01 10:28:55

Link to the problem:- Equal Average
I have tried to solve this question by rearranging the array in a way that a sequence of length k gets repeated so that the average of all k length subsequences is same. Now I need to place the elements in their appropriate positions and check whether any such sequence is possible or not. For that I have used priority_queue. The elements with greater occurrences will be placed first at separations of k.
Here's my submission, but it's giving wa, I don't know where I'm getting wrong. Any help would be appreciated.

Теги sieve, codechef lunchtime

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский vivekcrux 2019-09-01 10:28:55 704 Initial revision (published)