Mr.ink's blog

By Mr.ink, 10 years ago, In English

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.

Full text and comments »

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

By Mr.ink, 10 years ago, In English

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.net/contest/449/submission/7192350

Full text and comments »

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

By Mr.ink, 10 years ago, In English

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.net/contest/449/submission/7192350 UPD: I found the problem http://codeforces.net/contest/450/submission/7193321

Full text and comments »

  • Vote: I like it
  • -7
  • Vote: I do not like it

By Mr.ink, 10 years ago, In English

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.net/contest/439/submission/6814294

Full text and comments »

  • Vote: I like it
  • -15
  • Vote: I do not like it

By Mr.ink, 10 years ago, In English

I am trying to solv eproblem 442C I see other's code like http://codeforces.net/contest/442/submission/6971106 but i couldn't understand the logic of their code.I also read editorial of problem http://codeforces.net/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.

Full text and comments »

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