starbot's blog

By starbot, history, 7 years ago, In English

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.

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By starbot, history, 7 years ago, In English

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 )

Full text and comments »

  • Vote: I like it
  • +8
  • Vote: I do not like it

By starbot, history, 7 years ago, In English

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/

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it