ADANUM — Ada and Numbering[SPOJ] Need help

Правка en1, от MohamedSameh, 2020-05-01 01:17:22

Peace on you code forces Community

Currently, I'm trying to solve this problem.

I think the solution is a standard Mo algorithm,

I think the minimum cost will be to give the highest frequency value = 1 and the next highest frequency value = 2 and so on,

but How to compute the answer for each query,

I have tried to store each frequency in a set and for each frequency store the number it repeated but it gives TLE in test 15, I also see some code in git hub but I didn't understand what he is doing.

can you help, thank you.

Теги mo algorithm

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский MohamedSameh 2020-05-01 01:17:22 632 Initial revision (published)