FluffyPotato's blog

By FluffyPotato, history, 5 years ago, In English

This week has had many days where Codeforces went offline. I'm just wondering why this would happen... Thanks to the codeforces team for restoring the website and servers quickly each time!

Full text and comments »

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

By FluffyPotato, history, 5 years ago, In English

Hello Community

I'm wondering what's a good amount of time to stop and look at the solution for thinking of a problem. Usually, I think about a problem for 15-30 minutes before looking at a solution. During that time, I try to solve it naively, and speed it up OR run through a checklist of different techniques to do, Dp, Greedy, etc..

I'm wondering if it is worth it to spend more time, and if it is even possible to solve problems given an infinite amount of time.

Ex. Can a 1200 solve a 2000 hard problem given 5 days? Maybe impossible... maybe not... What is your experience?

Thanks Fluffy-

Full text and comments »

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

By FluffyPotato, history, 5 years ago, In English

Hello fellow Coders

I just submitted something it got WA after about 7000 test queries were correct. The test input size is huge, so there is no way for me to debug it in a feasible amount of time. I've checked all my code for common errors: long overflow, small issues, whatever. I'm sure this has happened to many people before.... How do you recommend debugging such a case? Is there anything to look for?

Thank you

Full text and comments »

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

By FluffyPotato, history, 5 years ago, In English

Hello all

Typically lazy propagation and segment tree updates come in the form "increase range l-r by diff". What if you want to update a segment tree like "update range l-r to val". So instead of a difference, you tell it precisely what number to update to.

How would you do this? Is there an article somewhere about this?

Full text and comments »

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

By FluffyPotato, history, 5 years ago, In English

Hello world! There is a choose function in math like "A choose B" notated sometimes like aCb I'm wondering if you can calculate this in O(1) in a program. Given two a and b, calculate a choose b.

You can definitely precompute many values, in an O(ab) loop keeping the factorials, but Can you do it without precomputation? However, precomputing also risks long long overflow. (usually choosing is much lower then the direct factorial value) Thank you

Full text and comments »

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