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

Автор fiire_ice, история, 6 недель назад, По-английски

This is the leetcode problem from a recent contest: https://leetcode.com/problems/minimum-number-of-seconds-to-make-mountain-height-zero/

For some reason, this solution gives a TLE: https://ideone.com/00tSfJ.

I have an alternative solution which passes, my question is why does the above solution give TLE?

This solution should not be giving TLE because:

-the while loop can have upto 56 turns (since 2^56 > 1e8 * 1e8)

-the for loop upto 10^4 turns

-and, the map.upper_bound() would take 17 turns (since, log_base2(2^17) > log_base2(10^5) > log_base2(no. of items in map))

So overall, 9.52 * 10^6 operations. But I still get a TLE here. Please help me understand this better.

PS: I know that above is a simplification because complexity represents order of growth with respect to input size but I still don't see why the above solution should not pass.

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

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

Автор fiire_ice, история, 20 месяцев назад, По-английски

Is the site working for you guys?

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

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

Автор fiire_ice, 20 месяцев назад, По-английски

Can anyone tell me what Leetcode private contests are? I couldn't find info online. Also link to its private contest rules seem to be broken and I have no idea what it will entail.

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

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

Автор fiire_ice, история, 21 месяц назад, По-английски

Hello Codeforces!

I recently gave a Newton Coding contest called CodeCrush on Valentine's. (of course I had nothing to do the entire day). The contest mentioned there would be prizes (in mail) but any further clarification regarding prizes has not been published as far as I have seen. On the site there is no mention of prizes, on Codeforces I really couldn't find any blog posts as well.

Can someone confirm whether there would be any prizes or not?

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

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

Автор fiire_ice, история, 23 месяца назад, По-английски

Hello Codeforces!

Recently I gave this OA at Impact Analytics, but I couldn't understand this problem at all. The language of the problem statement isn't clear. Can someone just tell me whether the problem is correct? By that I mean can someone see if all the test inputs outputs make sense or not. Here is the problem statement

Thank you, bless you, Merry Christmas, Happy New Year!

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

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