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

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

I am talking about the Problem COT2 on SPOJ. I am getting WA for this problem. I have been trying to get the error but i am unable to do so.Can anyone point out to any possible bug in my code. Thanks in advance.

Problem Link:- http://www.spoj.com/problems/COT2/ Solution Link:- https://ideone.com/0qRvNR

PS:- I had found a testcase which gave WA on spoj toolkit but the tree is too big so its not that helpful WA Testcase link:- https://ideone.com/elSPXG

Thanks.

Полный текст и комментарии »

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

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

My solution to the problem barely passed after many optimizations.... This problem mainly asks to calculate a function's value over a range of array and give output. My solutions uses a offline query method.(MO's algorithm) Can anyone suggest any improvements !!

Problem : http://mirror.codeforces.com/problemset/problem/86/D

My Solution's Link : https://pastebin.com/Gcuxet5h

Thank You !

(PS : any other ways to do the problem are also welcomed :D )

Полный текст и комментарии »

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

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

Hello !!!

I was wondering about how can we solve this problem using BIT.

I got AC using seg tree but I also saw a comment where someone solved it using BIT.

Help would be appreciated.

Thanks.

Problem :- http://www.spoj.com/problems/ANDROUND/

Полный текст и комментарии »

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