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

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

How to solve this problem.
I saw it in a contest conducted on 13 March 8:00PM-11:00PM IST .

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

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

I didn't implement this solution and don't know if this will work or not.

Construct a segment tree where the nodes have a frequency array. Using this type of segment tree we can find the frequencies of all letters in the range [l,r] in $$$O(logN)$$$ time.

Now once we know the frequencies ,we can quickly judge if that sub segment can be re arranged as a palindrome.

If a palindrome is possible, find the compressed version of the palindrome. ( For example the compressed version of this string aaabbccccd will be a:3 b:2 c:4 d:1 ). After you know the compressed version you will have to lazily propagate the changes i.e. new frequencies . Since the length of the compressed string can be at max 53 (palindrome like abcde...yzazy.....dcba) and lazy propagation works in logN , this approach will hopefully pass.

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

Can someone help me with this

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

Did anyone get a mail regarding placements from codekaze ? Could you mention your national rank, graduation year and graduation year rank if you did receive a mail regarding placements?

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

is there any way i can test my approach for this and other problem that were asked in the contest.(I cannot took part in the contest but want to upsolve)?.

Thanks in advance.

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

Has anyone received Amazon gift card?