ENG  RUSTimus Online Judge
Online Judge
Задачи
Авторы
Соревнования
О системе
Часто задаваемые вопросы
Новости сайта
Форум
Ссылки
Архив задач
Отправить на проверку
Состояние проверки
Руководство
Регистрация
Исправить данные
Рейтинг авторов
Текущее соревнование
Расписание
Прошедшие соревнования
Правила
вернуться в форум

Общий форум

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...
Послано Anton [SUrSU] 3 ноя 2006 11:52
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.