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?
Is there any community which uses python for cf or maybe can create one
Videos
So i am starting my competative programming journey And i am also working as python developer in company should i use python or cpp for codeforces Like my all work is on python ml dl data science related things Should i stick to python or jump on cpp I will hardly take me 10-15 days to jump on cpp bcoz i have already done it in past
Everyone replies will be appreciated
A solved around 1000 problems with c++
I wana use python in CP and be good with py
So I want to know tricks of python in competitive programing
For ex :
if I need log(n) container like set and map in c++
If I Wana use lower/upper bound similar functions, nex_tpermutation
Useful optimization tricks like in c++ we don't do Str=Str+" cpp"; but we do str+="cpp" to avoid TLE I'M SURE that in py there are functions to avoid and use others for the TLE.
Like use pypy not python (idk if it's accurate advice)
....etc
I'm sure that there are alot of tricks and things to learn for py in CP
So..
recommend me some blogs youtube or any other resources for that
Thank you allllllllllllllllllll ♥️
NOTE : I WILL NOT FULLY SWITCH TO PYTHON BUT I WANT TO DO SOME PROBLEMS IN PYTHON
Hello, fellow Redditors!
I’m looking to improve my competitive programming skills and want to practice thousands of questions in an effective and structured way. I’d love to hear from those who have a proven and foolproof method for doing this.
Some points I’d like advice on:
Choosing Problems: How do you select problems to ensure a balanced and comprehensive practice?
Difficulty Progression: What’s the best way to progress from easier to more challenging problems without getting stuck or overwhelmed?
Time Management: How do you manage your time effectively to practice regularly and consistently?
Learning Resources: What additional resources (books, websites, tutorials) do you use alongside solving problems to improve your understanding of algorithms and data structures?
Tracking Progress: How do you keep track of your progress and identify areas that need improvement?
I’d really appreciate any tips, resources, or personal experiences you can share to help me and others in the community practice more effectively.
Thanks in advance for your insights!
Some issues I have run into while trying to do this are: I need a data structure that does not have native support in Python (ex balanced binary search tree), I get a TLE with an algorithm that (I believe) has the right complexity to pass the test cases, etc.
I was just wondering if anyone has done most of them in Python and if they have any tips to get around some of the pitfalls of Python being slow and not always having the needed data structures.
Thank you for taking the time to read this!
I am going to start my college this year from next month onwards. I have just little knowledge of coding i.e. basics of python and html. How can I start Codeforces ? I want to start it asap as it will take time to get good at it. I'll complete C in this week. What all should I do right now so that I can start with Codeforces in the next week or two and be able to solve atleast the easy/beginner level problems ?
I've solved nearly 2500 LeetCode problems within a year. The first 700 took a lot of time, but I've become much faster since then. Now that I've nearly completed all the LeetCode problems, I'm looking to transition into competitive programming. However, I'm struggling with problems rated above 2000 on Codeforces.
How can I improve? Codeforces problems are taking significantly more time for me compared to LeetCode. Any advice, strategies, or resources that could help me get better would be greatly appreciated. Thank you all!
https://codeforces.com/problemset/problem/1619/A
this is the method i came up with, normally there wud be exception so i thought of parsing and checking if 1st parts equals the second remaining part of the string. i don't know what the errors. thanks 4 ur help guys.
for i in range(int(input())):
st=input()
for substring in range(len(st)):
if st[0:sub] == st[sub:]:
print("YES")
else:
print("NO")https://codeforces.com/problemset/problem/1791/A
You seem to be solving a different problem.
for substring in range(len(st)):
why are you doing this?
st[0:sub] == st[sub:]
This is the right idea but consider this a string "123321". How can you get the first half using a slice? How can you get a reversed last half slice. hint s[x:y:-1] reverses a slice. When you solve this the rest is easy.
I write too many if else statements in my code although my code works after some corrections my friend is able to solve same problems with a single statement or minimal code its not that my code doesn't work but i want to be a better problem solver please help me with your suggestions.
I am a beginner in 2nd year of college , have made my account on codeforces a week earlier and have solved 10-11 problems and the problems I am talking about are division two problems likes points on an plane and chess for three players.
Hello everyone, i hope u guys read this message in the best condition. I would like to have an advise,
Im currently 23 studying C++ in college but I really bad at that language because most of leetcode I did was in python but only took c++ in uni because they force me to, im a second year and currntly learning about DSA graph in both college and Neetcode. I also studied by myself about python from Neetcode and thats where I start to solve leetcode problems. i only practice in leetcode but just realized about this platform last month from Colin Galen, he really amazed me with his digusting solving skills. I really weak in math but I like solving algorithm, . Should I just finished all the neetcode algorithm lessons and jump right into codeforce or I need to get good at c++ first then start code force, Im currently reading competitive programming handbook c++ for the first few chapters also, should I just finished this book and jump in codeforce ?) or what? Please give me advise. Im trying to be data analys so codeforce has nothing much to do with my career but looking at algorithm and stress out is like a hobby to me and I want to be good at it.thanks
I’ve done a ton of LeetCode problems, as well as some contests that I’ve done very well in. I’ve heard that Codeforces has more difficult and interesting problems so I went to check out Codeforces.
However, I immediately find the Codeforces user interface, problem descriptions, and the way that you’re supposed to take input very confusing and unwelcoming. Has anyone had a similar experience? Can anyone help me get started with Codeforces?
Been using python for around 4 years at work now, and I realize I might do better at contests with c++. I know the basics but I’m infinitely slower with c++. Any tips? Or should I just start using c++ massively until I’m proficient? I also have some experience with C#, do you reckon if I’m more at ease with C#, it would be equally as good as C++ in terms of performance for codeforces problems?
-
don't use endl, use '\n' (endl is slow)
-
always include bits/stdc++.h (it contains all standard libraries, saves time)
-
make a template with some defines, they help a lot (stuff like FOR(i, 0 n) instead of for(int i = 0; i<n; i++), it's easier to write and edit than the long version)
-
unpacking exists: if you have a pair<A,B> p, you can do
auto[x, y] = p; (also for(auto[x:y]: map or vector of pairs) works)
-
always look at other people's code, you'll learn a lot of cool stuff
It’s like anything else, you just get used to it. Knowing C made it easier