Изменения рейтингов за последние раунды временно удалены. Скоро они будут возвращены. ×

Блог пользователя aritra_roy

Автор aritra_roy, история, 5 лет назад, По-английски

I couldn't understand as to what this problem is trying to specify. Link. At first I thought it was like the Longest Increasing Subsequence problem with an addition that the frequency of B[i] > B[j] is also a condition that should immediately follow. But seems like that's not the case. Looking at the editorial also didn't help. Can somebody pls help me understand the problem.

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
5 лет назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится

The problem boils down to something like this-

For any two different value elements in the sub sequence picked from A, the higher value element should have higher frequency.

So if you picked elements with values 1 2(For the sample), then the frequency of number of elements of value 1(freq=1) should be less than that of value 2(Freq=2). Ans = freq(1)+freq(2)=3.

Solution- https://www.hackerearth.com/submission/24515151/