|
|
вернуться в форумОбщий форумPlease, help to solve a problem... Послано Sergey 3 ноя 2006 10:13 Please, explain how to solve this problem, or give a link where solution is described. Task: Given a sequence of N integer numbers (say a array), it is necessary for each position i find amount of such j, that: (i<j) and (a[i]>a[j]). For example: input: 4 6 10 3 7 1 9 2 15 5 8 output: 3 4 7 2 3 0 3 0 2 0 0 Re: Please, help to solve a problem... You may use the idea of merge sort as for counting amount of inversions. Re: Please, help to solve a problem... Послано Sergey 3 ноя 2006 13:44 Thanks! I will try to solve this way. |
|
|