innoshark's blog

By innoshark, history, 5 years ago, In English

https://codeforces.me/contest/292 Hello, I was just attempting to do a question from the contest and then I was shocked to discover that this contest only has a russian editorial. Can someone please provide an english editorial, especially for question E which seems to be a very nice question and I would really like to learn how to do it? I have thought of solving it with segment trees, but haven't succeeded in writing out the code. I have researched everywhere on the internet for it but couldn't find nor the editorial, nor any mention for question E. Thanking you in advance

Full text and comments »

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

By innoshark, history, 5 years ago, In English

Hello, I was just attempting this questionhere and solved it by writing out this code here. However, my original thoughts on this question, were to write out a normal dp and then optimize it using matrix exponentiation, and then do binary search on all values of n. However, I got confused and I did not know how to do the optimization. Can someone please explain to me how this could be done?

Full text and comments »

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