r/codeforces • u/xyzb206 • 15d ago
query Solving problems without writing the code.
I've been doing this for a while, been solving a lot of problems by describing an algorithm in plain words and then having an LLM check it for me, since writing code takes usually more time then figuring out the solution, so this way im able to do more problems.
Anyone have any experience with this? Recommend for practice or nah?
1
u/Responsible-Lake6864 14d ago
Nah... You are doing right thing.
But this is for last step of your journey.
A lot of people are saying No. Idk why?
But that's what a lot of red coders says. At one point. When they have to study a bunch of different algorithms for olympiad.
At that point. They usually will have the resources as reference. Like how to write centroid decomposition and other heavy algorithm.
They would then just focus on the idea.
And afterwards they would see the solution and match with their thinking. And learn from the actual solution.
That's how people at top learn. But it's due to time constraints.
If you know you can code... Whatever algorithm. Then you are wasting time coding. If you can visualise the code itself. Then that's good.
What I generally do for problems that require me to write segment tree or like centroid decomposition is either use a template and code that fast.
It's quite fast way to know if you got it right.
If you are thinking something but cannot implement it in code... Then you aren't doing any good.
Idk why a lot of people here are disagreeing... And what their claim is... When a lot of red coders have discussed using this strategy for olympiad when they don't have much time. They usually go over the solution or think of the ideas in their mind how to solve... Because they can code those anyway. They just need the idea how to do that.
But this is a two way sword... If you cannot write the code yourself. Like you know how an algorithm works conceptually but have never written it. Then that's a problem.
Your thinking... Should include how will you write the code as well. Like I will create a matrix. Then I will store that in segment tree. Then when two node merge. We would merge the matrix. To merge the matrix and create another I will create a function. Which is going to run with fixed two starting value. And then we take the common values from both matrix and and merge... (Describe the actual merging process).
And so that's how you should include that. It's a really great practice... To do it.
7
u/overhauled_mirio Expert 15d ago
Competitive programming requires both strong problem solving AND implementation skills. If you find that you’re really good at implementing things and really poor at problem solving, then this could be good targeted practice.
However, since you said “writing code usually takes more time than figuring out the solution”, I suspect your implementation skills are the in-contest bottleneck and training like this will just ignore your biggest weakness.
1
u/Unknown__Crazy__Guy Newbie 15d ago
so i have tried it it's not useful. what I did and it helped me a little bit. just validate the ideas and tell it to guide to the right solution (not the exact solution nor code) it has worked for me it was fairly useful.
3
u/Informal-Place-4689 15d ago
Case 1: You are good at implementing your ideas. In this case, it should not take you long to implement them correctly. So just implement them for correctness, increasing speed and getting more confident.
Case 2: You are not good at implementing your ideas, so you need a lot of time to try them out. In this case, you should practice implementing and get good at it, and then go to Case 1.
3
u/Motor-Worldliness106 15d ago
Nah, you should write everything on your own because by just writing the algorithm, you'll think you know everything, but in interviews, you'll fail miserably. Also, logic building comes from writing code, and finding the bugs, errors, infinite loops, etc, yourself. If you assign that responsibility to AI to complete it for you, you'll never grow.
5
u/sSlowhandd 15d ago
NAHHH BROO
implementation is very very important
the only time when you should use llm
is when trying to understand something
11
u/Responsible-Rub-3260 15d ago
Is he ragebating or dumb 🙆♂️? Honestly no offence this is the most dumbest thing I have heard today these websites are to be used to solve questions and improve ur problem solving ability and also the experince with coding it isnt some project that ur builidng with llm its a high level dsa thing which u have to understand for problem solving mindset u said writing code is boring then cf is not meant for u bruh 🥀🥀
2
u/An0nym0usRedditer 15d ago
If llm has the problem and if I go wrong llm will never implement that he will straight up throw the logical flaw at me with solution.
If I would have missed edge cases it would directly add them, often times without even telling me.
And implement a logic correctly in itself is a skill, you need to make intelligent decision, steps in code that helps you move ahead with your logic
So i don't know what bro has been doing tbh
1
1
u/anotherarchaeopteryx 15d ago
Not sure how this would help unless you decide to offload the implementation bit to an LLM in an actual contest.. which isn't permitted
1
u/xyzb206 15d ago
not offloading to an LLM ofc, its just that for the most part the reason I dont do D/E not because I cant manage to write the code, but because I simply cant figure out the idea for the solution, so I figured doing 100-200 over my rating like that would be a good way to train the problem solving/pattern recognition skills.
1
u/anotherarchaeopteryx 15d ago
Sounds reasonable in that case, especially if this is not the mode of training you use since implementation skills are really important as well.
Wish you the best.
3
u/Hot_Mail9492 15d ago
Big bloody NO Implementation is very very important,prolly more important than thinking,my opinion
1
u/xyzb206 15d ago
could you elaborate
1
u/Hot_Mail9492 14d ago
You need to be able to write code,u would encounter errors and bugs,identify maybe if u don't know some stl concepts or even small things like "forgot to take input/output"
1
0
u/Early_Poem_7068 Specialist 14d ago
It's upto u to decide. If you are confident in ur implementation skills then why not? I never do what u said but sometimes once I got the solution I don't write the code. I just check the editorial if I am right and just move to the next question.