Fearless_cod's blog

By Fearless_cod, history, 2 years ago, In English

Hi reader. Coming straight to the point. The value of (1ll<<59) or 2^59 is 576460752303423488(say x).So if you do log2(x),the answer should come out to be 59.That's indeed the case. But here is the catch... .If you do log2(x-1) in C++ 14(not sure for other versions),it also gives 59 as output..(but actual answer is 58), which is wrong and that caused me a fst in recent Div 3 problem F.

So, can anyone explain why is this happening and how to avoid these types of things. Thanks for spending your time in reading this blog.

Full text and comments »

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

By Fearless_cod, history, 3 years ago, In English

In** problem E** of yesterday's round, I misread the question and thought of a completely different problem the whole time. But this problem might also be interesting for some of you guys. So, here goes the modification:- Instead of swapping any two elements, you can swap only two adjacent elements and the constraint on m is m<=n.

I can share my idea and code also for this problem which I think works. Meanwhile, if any of you guys know any links where we can submit this problem, please share it.

Thanks for reading.

Full text and comments »

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

By Fearless_cod, history, 3 years ago, In English

Can anyone explain to me how am I getting a positive delta for today's contest? Thanks.

Full text and comments »

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