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

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

I was trying out segment tree problems and had some confusions in understanding the solutions for problems involving segment tree with offline queries.

Here are two problems GQR and 301D - Yaroslav and Divisors, for which I was referring to solutions GQR_AC and 36281412 respectively.

If anyone could help me understand these solutions in detail, it would be a great help.

Thanks!

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

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

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

The problem is GSS1 and my solution is very close to AC but I just can't seem to find why my code gives SIGSEGV segmentation fault on G4G IDE. I request you to take a quick look at the code and let me know, it will be a big help! Thanks a lot!

PS- I used segment tree to store sum, maximum prefix sum, maximum suffix sum and maximum subarray sum in a segment.

Edit:- Nevermind, I found the mistake. I was initialising a node with all four variable values as LLONG_MIN which should't have been done because adding a negative number to that will cause overflow. Also, in build function I forgot the start>end case.

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

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

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

Hi guys! I was wondering if this problem:- https://www.codechef.com/problems/BITMASK4 can be solved using DFS within the time constraints. Any help will be appreciated. Thanks you!

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

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