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

Автор deam0n, 12 лет назад, По-английски

Hello all

I'm trying to solve the problem http://www.spoj.com/problems/HORRIBLE/ but getting WA again n again. I'm using segment trees with lazy propagation. Can somebody please help figure out my mistake.

Thanks in advance.

Code: http://pastebin.com/aT3pvi3K

-- Thanks to diego_v1

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

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

Автор deam0n, 12 лет назад, По-английски

I'm trying to understand Heavy-Light decomposition method for answering LCA queries , but stuck with it. I'm not able to understand the concept of exactly why you needed "vertex-disjoint" and "edge-disjoint" paths. And as I see in some problems we pre-process "edge-disjoint" paths with segment trees. Why we would do that?

Can some help in rephrasing the whole idea step-by-step? I'm following problem E from http://felix-halim.net/story/icpc10/problems.pdf . Any help would be appreciated.

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

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

Автор deam0n, 12 лет назад, По-английски

I'm trying to solve a RMQ problem at lightoj using Segment Tree , but it always gives me TLE. Can anybody help in pointing out my mistake ?

Problem link : http://www.lightoj.com/volume_showproblem.php?problem=1082

Code link : http://pastebin.com/UqaumDKG

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

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