JasonMendoza2008's blog

By JasonMendoza2008, history, 5 days ago, In English

I asked to get hacked because the tests of the last contest were weak and my O(n*10^6) solution had passed (https://codeforces.net/contest/1989/submission/267752822). Someone nicely hacked it (https://codeforces.net/contest/1989/hacks/1052821) — really appreciate the community btw.

I fixed the code and now it's (10^6 * log(n)) (https://codeforces.net/contest/1989/submission/267775979). To be sure I fixed the code I would LOVE to re-run that test case that got me TLE but I'm not going to ask this person again and again to hack my submissions just to make sure I managed to improve my solution.

How can I reproduce the hack? Why aren't hacks added to the test cases automatically? I thought that was the case but I think it's just for the contests with open hacks.

EDIT: well the person gave me the code to generate the hack so that's nice I don't need it anymore but it would be nice to have the possibility to get the code right?

Full text and comments »

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

By JasonMendoza2008, history, 6 months ago, In English

Coincidently I was wondering a few weeks ago why codeforces was using such an outdated version of Python (https://codeforces.net/blog/entry/122386) and now Python 3.12.1 is live. As an example of why that would be useful: https://codeforces.net/contest/356/submission/240013817 is accepted whilst the exact same solution (https://codeforces.net/contest/356/submission/233016779) was not a few months ago. Probably not the best example since PyPy was able to go through for that particular example but I thought it was worth sharing.

Full text and comments »

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

By JasonMendoza2008, history, 8 months ago, In English

The general consensus is that competitive programming is competitive so if you're going to choose a slower language (like Java or especially Python) you need to be ready to deal with the potential setbacks and advantages of your chosen language. It's fair to say that Codeforces isn't supposed to accommodate your language choice by increasing the time limits according to the language especially if it's a poor one that is known to be slower than something like C++. HOWEVER, Python version on codeforces is currently 3.8 (out for 4 years) and versions 3.11 and 3.12 both bring speed improvements (3.11 for a lot of stuff (https://docs.python.org/3/whatsnew/3.11.html#:~:text=Python%203.11%20is%20between%2010,See%20Faster%20CPython%20for%20details.) and 3.12 for comprehensions (https://docs.python.org/3/whatsnew/3.12.html#:~:text=This%20speeds%20up%20execution%20of%20a%20comprehension%20by%20up%20to%20two%20times.)). I know loads of people use PyPy (and it does seem to work very well, cf. https://i.imgur.com/v9iOJnw.png) but it would seem relevant to allow newer versions of Python (**I would even argue it will help lower the CPU demand on codeforces servers since both versions are known to be faster** so realistically ... why not ...).

I've just started codeforces so maybe this has been discussed before but I haven't seen any topics talking about it and i honestly don't think there'd be any drawbacks in getting a newer, faster version of Python on the website.

Full text and comments »

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