alfaloo's blog

By alfaloo, history, 13 hours ago, In English

Hi fellow Codeforcers,

I hope everyone is well and Happy Chinese New Year for those that celebrate! Today I visited the leader boards of the recent few LeetCode contests (the platform where I used to do contests). Sadly, I noticed that quite a lot of contestants in the top 10 were caught cheating (their contest submissions were skipped on their profile). Furthermore, combined with the recent launch of DeepSeek-R1 and Qwen2.5-Max, I can not help but fear that the day an AI LLM can also easily solve Codeforces type questions is just a matter of time...

I am someone who truely enjoys the thrill and excitement of competitive programming, and I'm sure most of you here are as well. Therefore, I'd just like to hear some of your thoughts on the future of Codeforces (or competitive programming in general), and whether there are any ways we can reliably filter out cheating to ensure that the sport/game we love lives on!

Full text and comments »

  • Vote: I like it
  • -14
  • Vote: I do not like it

By alfaloo, history, 2 weeks ago, In English

Hello, hope you are all well. As a fellow Codeforcer, I hate the feeling when my code gets hacked or stuck on a private test case for a trivial reason. Thus I wanted to create this thread where everyone is encouraged to share some niche case where their code unexpectedly broke :(

I'll start first:

  • In the Hello 2025 problem A, my unordered hash structure got TLE hacked. Solution is the use a custom hash function, courtesy of Neal's post.

  • In Codeforces Round 996 problem D, I tried printing a double to console in cpp. For large values, doubles defaults to scientific notation (e.g. 1.2345e+7), so I was stuck on that private test case for the whole contest :(. Solution is to cast the result to int or long long before printing.

  • I've read somewhere that sqrt and log functions can have precision issues at large values? I've never encountered an error when using them so far though.

I hope my mistakes are helpful to you all :)

Full text and comments »

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

By alfaloo, history, 5 weeks ago, In English

Hi fellow Codeforcers,

Merry Christmas, I hope you are all well. Apologies in advance if this question has been raised before. I noticed that in Codeforces div3 and education rounds, the standings are calculated as the sum of the times to solve each question. However, on previous sites where I used to practice, the standings are calculated as the maximum of the times needed to solve each question. For example, on Codeforces, someone who solves q1 by 1 minute and q2 by 60 minute will receive score of 61, whereas someone who solves q1 by 59 minute and q2 by 60 minute will receive 119. In my opinion, I believe these two contestants should be ranked equally as they both finished the first two questions in the same amount of time (if anything, the second contestant solved the supposedly harder question in less time). Hence, for those who believe the current ranking system is fairer, I would love to hear your perspective and understand why the ranking system is calculated this way instead?

Edit: Just came across this older discussion https://codeforces.me/blog/entry/127921. Explanations here are very convincing!

Full text and comments »

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