Codeforces
codeforces.com โบ blog โบ entry โบ 21851
Python performance tips - Codeforces
it's ok to use Python list as an array; it has O(1) element access time. It is NOT ok to use it as queue, even if the list is sorted. Use collections.deque instead if you need fast extraction of the max element. finally, realize that acceptable solutions to many Codeforces problems simply cannot be coded in Python, no matter how hard you try.
Codeforces
codeforces.com โบ blog โบ entry โบ 63102
Python Performance++ - Codeforces
TL;DR: Links for the master template and algorithms. Based on prior benchmarking on Codeforces, it is quite conclusive that PyPy 2 is the fastest version of Python available on Codeforces.
Videos
03:30
41A | Translation | Codeforces Python Solutions | Explanation + ...
133A | HQ9+ | Codeforces Python Solutions | Explanation + ...
231A | Team | Codeforces Python Solutions | Explanation + ...
09:25
158A | Next Round | Codeforces Python Solutions | Explanation + ...
32B | Borze | Codeforces Python Solutions | Explanation + ...
08:28
Solving problems on codeforces.com with Python - "271A - Beautiful ...
Codeforces
codeforces.com โบ blog โบ entry โบ 145399
Python Optimization Tricks in Competitive Programming - Codeforces
It is worth noting that due to Python's inherent nature, no matter how well it is optimized, it cannot pass problems with large data range and high complexity[^1]. Additionally, the time spent on coding Python and optimizing it afterward is not necessarily faster than directly using C++. Therefore, although Python has some fantastic language features, if you want to engage in professional competitive programming, it might be better to leave the obsession in Python and learn C++ instead. For the following reasons, the content of this article is mostly empirical and may have some imprecise points: the inner principles are not fully clear; comparative experiments are required for verification; there may be differences in performance between CPython/PyPy and multiple versions of Python.
Codeforces
codeforces.com โบ blog โบ entry โบ 61298
Issue with Python ! - Codeforces
I understand that Python is slow and this is a competitive space ! I agree that there should not be a multiplier but there could be then a defined time limit for each question in each language using the same solution ! I agree multipliers don't work well and always keeps someone at an advantage or a disadvantage ! But there are a lot of languages that CodeForces supports, so either is stops supporting them in contests or has a defined time limit for each question serperately for each problem because the current scenario won't allow any other language to progress in the competitive world !
Codeforces
codeforces.com โบ blog โบ entry โบ 83441
Ways for Fast Input / Output in Python - Codeforces
Argentum47 โ Codeforces Round 1089 (Div. 2) aladdin.abdinli1 โ HELLO NE BAKIYOSUN KARDESIM GIT CODE YAZ ยท yash_daga โ Invitation to CodeChef Starters 134 (Rated till 6-Stars) โ 15th May ... Input / Output in Python can be sometimes time taking in cases when the input is huge or we have to output many number of lines, or a huge number of arrays(lists) line after line.
Codeforces
codeforces.com โบ blog โบ entry โบ 122386
Python 3.12 on codeforces? - Codeforces
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 3.11 is between 10,See Faster CPython for details.) and 3.12 for comprehensions (https://docs.python.org/3/whatsnew/3.12.html#:~:text=This speeds up execution of a comprehension by up to two times.)).
Codeforces
codeforces.com โบ blog โบ entry โบ 61508
Python 3 performance change - Codeforces
My copy, TLE, August 2018: http://codeforces.com/contest/372/submission/42224415 ยท I also realized that the individual tests differ in memory and time, where recent executions (August 2018) use less memory but need more time. Problem 222b, submission 33921342, test 1 requires Time: 60 ms, memory: 5428 KB ยท Problem 222b, submission 42010082, test 1 requires Time: 216 ms, memory: 0 KB ยท Some ideas about the possible reasons? I can only think in different sub-versions of Python 3, something else?
Codeforces
codeforces.com โบ blog โบ entry โบ 46459
For Python Coders - Codeforces
Argentum47 โ Codeforces Round 1089 (Div. 2) aladdin.abdinli1 โ HELLO NE BAKIYOSUN KARDESIM GIT CODE YAZ ยท yash_daga โ Invitation to CodeChef Starters 134 (Rated till 6-Stars) โ 15th May ... I started learning Python a week ago, and I've just solved my first problem using it.
Reddit
reddit.com โบ r/codeforces โบ anyone who uses python for cf?
r/codeforces on Reddit: Anyone who uses Python for CF?
July 24, 2024 -
I am still new to CodeForces, and I used to solve leetcode questions with Python3, So i was wondering anyone uses Python for CF and taking parts in the contests too?
Medium
medium.com โบ @saifsweelam โบ getting-started-with-codeforces-as-a-python-developer-4c5ea6ad9f04
Getting started with Codeforces as a Python Developer | by Seif El-Din Sweilam | Medium
July 8, 2023 - C/C++ provide the least execution time and memory usage in most cases (according to personal experience) but some problems which include long implementation can take a long time to write code and debug because the built-in functions donโt perform all what you expect, so you have to do some manual stuff. They are a great choice if you wish to participate in an official contest, but you should get used to one of them. Python in the other hand takes much longer execution time, but you should be able to solve more than 70% of the problems using it.
Codeforces
codeforces.com โบ blog โบ entry โบ 103733
Python compiler - Codeforces
But I think it's not such a big price to pay for the ability to solve tasks in Python that only C/C++ and other compiled languages can handle at the moment. (Most of these nuances and peculiarities are listed in this guide.) The only alternative to this transpiler with comparable speed is essentially only Cython, but there you have to practically rewrite the code to achieve comparable performance.
Codeforces
codeforces.com โบ blog โบ entry โบ 44727
Problem with python?? - Codeforces
Muhammadali_2009 โ Codeforces Round 1062 (Div. 4) SoloSerenade โ NITS Hacks 8.0 Inter College Coding Competition (Prizes worth 1.1 Lakh INR) ... I dont know why it catch time limit exceeded on test 148. And then, I try g = l + (r-l+1) / 2, it is accepted? (g is midle in binary search), Im a newbie in python, and sorry for my bad in English
arXiv
arxiv.org โบ html โบ 2501.01257v1
CodeForces: Benchmarking Competition-level Code Generation of LLMs on CodeForces Disclaimer: This is a non-traditional code benchmark.
January 2, 2025 - We conducted experiments where models were given prompts without a specified programming language, allowing them to choose freely. We found that under our CodeForces, nearly all models defaulted to using Python more than 95% of the time, with only occasional use of C++, Java, and others.
Codeforces
codeforces.com โบ blog โบ entry โบ 145514
Python for Competitive Programmers - Codeforces
TheScrasse โ Codeforces Round 1066 (Div. 1 + Div. 2) Editorial ยท wuhudsm โ TheForces Round #45 (DIV3-Forces2, TheForces Rated, Prizes!) ... python-competitive is a new open-source Python library packed with the data structures and algorithms you need for competitive programming โ from segment trees, tries, and heaps to modular arithmetic, prime sieves, and fast sorting/searching.
Codeforces
codeforces.com โบ blog โบ entry โบ 74143
Is Python (pypy) fast enough to solve codeforces problems? - Codeforces
Hi Codeforcers! I haven't seen yet a problem that gives Time Limit Exceeded when using Python (Pypy) instead of C++. I would like to know if anyone has encountered such kind of problem in the past. I am especially concerned by instances of expert competitors like Egor Kulikov switching from Java to C++ because of performance ...