SPOJ-FREQUENT — Frequent values

Правка en1, от S.J.patel, 2017-07-04 16:37:16

Hi, Question: http://www.spoj.com/problems/FREQUENT/

I am getting WA in my below mentioned Code and i have tried many test Cases but the issue still remains same. Can anybody please help me? My basic logic is that when the best left part and the best right part are both of the same element, then the parent node made from these two parts will have the best made of the same element and frequency equal to the sum of the best left and right frequencies.

And if the best left and best right are not of the same element, then I'll check if the two child segments are internally joined by some common element.

Code: https://ideone.com/uhftBt

Теги segment tree, advanced data structure, solution spoj

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский S.J.patel 2017-07-04 16:37:16 684 Initial revision (published)