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

Автор Mr.ink, 10 лет назад, По-английски

I am learning segment tree with lazy propagation but i can't find good tutorial. Can anyone post a code that implements this two operation with segment tree and lazy propagation:

a-add a value to every element in a interval b-get the. sum of interval.

Thanks in advance.

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

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

Автор Mr.ink, 10 лет назад, По-английски

Can somebody help me with problem B of Div 1. I implement the solution of editorial but i get WA on test 5 and i can't debug the code. I think it's absurd. Here is the code: http://codeforces.com/contest/449/submission/7192350 UPD: I found the problem http://codeforces.com/contest/450/submission/7193321

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

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

Автор Mr.ink, 10 лет назад, По-английски

Can somebody help me with problem B of Div 1. I implement the solution of editorial but i get WA on test 5 and i can't debug the code. I think it's absurd. Here is the code: http://codeforces.com/contest/449/submission/7192350

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

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

Автор Mr.ink, 10 лет назад, По-английски

For problem 439D there is a ternary search solution that works very well but this is a ternary search on integers and it can go into an endless loop but the author of questions says it works correct.Why does this solution work?if hi = 3 , lo = 1 when answer is 2 ?The ternary search in this state can not reach 2. here is the code http://codeforces.com/contest/439/submission/6814294

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

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

Автор Mr.ink, 10 лет назад, По-английски

I am trying to solv eproblem 442C I see other's code like http://codeforces.com/contest/442/submission/6971106 but i couldn't understand the logic of their code.I also read editorial of problem http://codeforces.com/blog/entry/12739
but i can not understand how it handle situations like 1 100 101 200 when the minimum is in the elements that we can not remove.

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

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