Explain approach to solve this problem

http://www.cplusplus.com/forum/general/123362/

hello @ajayrajsingh_817
do u have link for this problem ?
pls share it with me.

logic is simple , the person who is having maximum score assing less points to him so that chances of wining of other participant get maximized.

that is why they have first sorted it in decreasing order.
and then giving 1 to person with highest score before the race , 2 to 2nd highest and so on…

this question is same as optimal game strategy???
sir samjh nhi aya plzz explain in better way sir plzz

greedy approach hai bhai, tumhe winners maximize karne hai.
wo hum kaise kar sakte hai ?
jiske pehle hi jayada points hai usko kam points denge aur jiske kam points hai usko jayda points denge taaki .
jiska kam points the wo ab jayda points ho jaye aur use wining chances badh jaye.

sir decide kaise karenege kisko kite point dene hai

jiske sabse jayda point hai ,usko sabse kam yaani 1 point
phir jsike 2nd highest hai usko 2.
3rd highest ko 3.
so on.

can you plzz share me code

it is already given in ur shared link.

nhi samjh aaya wo wala

yaar wahi to kiya hai ,jo maine samjhaya hai.
pehle decresing order mein sort kar diya.
phir un sab me i+1 add kar rahe hai +1 kyunki 0 based indexxing hai.

wo loop me bus yahi ho raha hai
1st max +1
2nd max+2
3rd max +3

ab bhi samjh nahi aaya to dry run kar lo paper pe.