Compute the result, store in the variable unfairness -įor (j = 0, k = K - 1 k (list - list) ) Note: Integers in the list N may not be unique.Īn integer that denotes the minimum possible value of unfairness. Each line contains an integer that belongs to the list N. Where max denotes the largest integer among the elements of K, and min denotes the smallest integer among the elements of K. If (x1,x2,x3,xk) are K numbers selected from the list N, the unfairness is defined as max(x1,x2,xk)-min(x1,x2,xk) Given a list of N integers, your task is to select K integers from the list such that its unfairness is minimized.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |