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

Автор Fearless_cod, история, 2 года назад, По-английски

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.

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

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

Автор Fearless_cod, история, 3 года назад, По-английски

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.

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

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

Автор Fearless_cod, история, 3 года назад, По-английски

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

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

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