Codeforces Round 1133 (Div. 1, Div. 2) is coming soon! Register here. ×
Help Needed in solving the problem
Difference between en1 and en2, changed 6 character(s)
I got this question in a company's coding round:↵
↵
↵
Find the minimum cost to make all the elements of an array equal, when 2 operations can be performed-↵
↵
1. Increment an element by 1 which costs 'a' units↵
2. Decrement an element by 1 which costs 'b' units↵
↵
↵
Constraints:↵
↵
Array size <= 10^5↵
↵
a,b <= 10^5↵
↵
0 <= element <= 10^6

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English DaviddeGea1 2020-02-09 23:10:41 6 (published)
en1 English DaviddeGea1 2020-02-09 23:10:00 368 Initial revision (saved to drafts)