rahulnagurtha's blog

By rahulnagurtha, history, 9 years ago, In English

I have tried solving this http://www.codechef.com/problems/CHEFD/ problem using sqrt decomposition technique,but im getting AC for some cases and wrong answer for some cases......Can anyone discuss your idea using sqrt decomposition method for this problem,thanks......

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

»
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by rahulnagurtha (previous revision, new revision, compare).

»
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Do you already read the editorial?

Link: http://discuss.codechef.com/questions/51848/chefd-editorial

»
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it

There is actually a cute way to solve the problem by processing the queries in reverse order and using segment trees/bit to keep how many times a value has been divided with on a certain position.

»
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by rahulnagurtha (previous revision, new revision, compare).