I just checked your Codechef profile and you have solved only 38 problems. Solving 38 problems is way too low. You have participated in around 14 contest, accounting for an average of 2 problems/contest, you have just solved 10 extra problems. This would no doubt wouldn’t give you any result. You aren’t upsolving, you aren’t training either.
You can learn Math algorithms, but I doubt it is going to help. Unless you start solving problems, you may learn any number of algos you want but you won’t improve.
You are an inspiration @ssjgz. Nice performance in the ongoing contest. As usual, I am unable to figure out medium and harder problems from Div-1, even I need to work harder. By the way, waiting for your awesome editoral style solutions. Make them as great as always.
In my opinion, there is no point of getting stuck on a problem for too long. If you are unable to solve after some time(that some can vary from person to person , but I believe an hour or two should be enough, if you have run out of ideas after this time. There is no point of continuing any further), then it’s better to look for the solutions. The important thing is you should avoid making same mistakes again.
Find a friend who is similar to you and just compete among each other.
I became 5 star in first 11 contest.
It’s because of competition I got from @black_truce .
He was the one who brought me into competitive programming.
We used to compete with each other really nicely. We don’t even share hints .
I am L from “death note” and he was Kira
We were rivals.
This will make environment competitive and you’ll definitely give your best. It will make things interesting. You will also uplsove when you got a nice company (/competitor)
It’s not like we were enemies. We used to teach other things after contest.
Edit : @m_never_dies is also a nice friend of mine and he also helped me in getting better.
You need to get out of your comfort zone. Just make it a habit to upsolve atleast 2 problems you could not solve during a contest, by trying later or reading editorials. And give contests on a very frequent basis.
I think @ssjgz is showing his own pc, That he has solved 272 problems and has codes for each one of them in his pc, and he has just taken part in 4 contests.
So practice == everything
Gosh - this “stopstalk” site works really well - I knew I used to solve questions using the Hackerrank IDE and not storing a copy locally (shudder), but I didn’t know it was this many.
I will answer your question in steps This answer is solely based on my journey till now .
Step 1: Analysis the constraints properly . Remember 1sec=10^8 operation principal u should analysis whether your code pass all test cases within limit or not.
Step 2: Convertion of thoughts into codes
Learn all fundamentals library function/containers of your favourite language. For example in c++
U should have good knowledge of stl u should know and able to use vectors,sets,maps ,pairs, priority queue,and combination of these like vector of pairs ,map of vectors etc.
By doing these two steps u should be able to solve 2-4 problems in div2 long challenges
Step 3:Learn important data structures and algorithms .
U should know proof and use of these algorithms . The better your knowledge the more comfortable u will become while solving problems.
few algorithm that commonly used are
Range queries (segment trees,Fenwick trees)
Dfs,bfs, Dijkstra
Dynamic programming
Preprocessing,sieve method
Modulo properties
Two pointers, binary search
Step 4: Practice practice practice
Participate in contest do upsolving problems as much as u can.
Cover all remaining topics such as min-cut max flow dp on trees,dp on graph ,meet in middle by upsolving or just solving in practice section.
Learn on the go while solving problems. It’s a long journey and u will enjoy it a lot.