pajenegod's blog

By pajenegod, history, 3 months ago, In English

I've always liked using Python (PyPy) for solving problems in competitive programming. And most problems are very doable, even in Python. What I've found is that the most difficult problems to solve in Python are those requiring 64 bit integers.

The reason why 64 bit integers are problematic is because CF runs Windows, and PyPy only supports 32 bit on Windows. So whenever a problem involves integers that cannot fit inside of a signed 32 bit int, PyPy switches to big integers (which runs insanely slow, sometimes a factor of 20 times slower).

What I currently have to do to get around big integers

However with the latest PyPy version (version 7.3.4) PyPy has finally switched to 64 bit on Windows! So upgrading PyPy would mean no more problems with big integers. This would make PyPy far more usable and more beginner friendly. So if possible please update PyPy's version on CF to 7.3.4! MikeMirzayanov

Edit: Reading Results of 2020 [list some changes and improvements] blog I realized that I should probably be tagging geranazavr555, kuviman and cannor147 too.

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

»
3 months ago, # |
  Vote: I like it +30 Vote: I do not like it

Auto comment: topic has been updated by pajenegod (previous revision, new revision, compare).

»
3 months ago, # |
  Vote: I like it +41 Vote: I do not like it

I got TLE on a problem where n^2 should have passed because of this issue, so I think this would be very helpful.

»
3 months ago, # |
  Vote: I like it +34 Vote: I do not like it

I too, as an python main, really struggled upon this specific matter. Hope this change ships soon so that more people can focus and enjoy the nature of problem-solving with python, not exploring some deprecated features just to make some plain old multiplications to get going.

»
3 months ago, # |
  Vote: I like it +5 Vote: I do not like it

Clever workarounds in 1 and 3.

»
3 months ago, # |
  Vote: I like it +5 Vote: I do not like it

Hey, the community should need to take this blog seriously and make the required changes in PYPY. during the contest, I made logic and coded it but the submission got TLE. I taught my approach was not optimal and started to think of other ways to solve that problem. finally ended not solving it. after the contest realized My idea is the only optimal way to solve it and all the people with python submission got TLE, only a few people who already know the above trick got accepted in PYPY. The tester of the round should have tried python also and they would have figured the TLE problem or they have not tested with python. please Do the need full I believe solving problems and learning should need to be the main goal the programming language we use should not be a barrier to it.

»
3 months ago, # |
  Vote: I like it +8 Vote: I do not like it

Auto comment: topic has been updated by pajenegod (previous revision, new revision, compare).

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

It is probably dumb to ask but can anyone tell me how to update PyPy version on CF

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    It is not for you to update. You will be able to use the new version when Codeforces updates it on their site.

»
6 weeks ago, # |
Rev. 2   Vote: I like it +41 Vote: I do not like it

I will just bump this thread as it seems extremely relevant to today's contest

»
6 weeks ago, # |
  Vote: I like it +9 Vote: I do not like it

bump. relevant to C and D of Codeforces Round #727 (Div. 2)

»
6 weeks ago, # |
  Vote: I like it +12 Vote: I do not like it

I am just bumping as no action has been taken
and today many suffered due to this

I know some people will say just switch to C++ but is that really a solution?

»
6 weeks ago, # |
  Vote: I like it +35 Vote: I do not like it

Pypy authors stopped releasing 32-bit version and its slightly tricky to support 64-bit version in our current setup.

  • »
    »
    6 weeks ago, # ^ |
      Vote: I like it +88 Vote: I do not like it

    OP isn't just asking for an upgrade of PyPy's version, he specifically wants the 64-bit version. Even if the pypy author had continued supporting 32 bit, upgrading that wouldn't solve our issues!

    The analogy is something like 64 bit C++ gave them the __int128 type. 64 bit pypy will give us ... long long. Like we will finally be able to multiply two int and take a mod without TLEing. That's the pathetic state of python on CF right now. (And it really is a CF specific problem because who else is still stuck using 32-bit in 2021)

  • »
    »
    6 weeks ago, # ^ |
      Vote: I like it +144 Vote: I do not like it

    Hi geranazavr555, thanks for reply!

    The reason why I wrote this blog was to request Codeforces to upgrade to 64 bit PyPy, and to talk about the benifits of 64 bit vs 32 bit. There are some really huge benifits gained from switiching to 64 bit PyPy.

    Pypy authors stopped releasing 32-bit version

    This doesn't really matter, at least not as far as this blog is concerned. This blog is about upgrading to 64 bit PyPy, and not about updating the current 32 bit version.

    its slightly tricky to support 64-bit version in our current setup.

    That is unfortunate to hear. But at least know that in my opinion (and in many other people's opinion) 64 bit PyPy is by far the most crucial feature missing on Codeforces.