Usually, red coders speedrun A, B very fast while I'm still having trouble reading the statement, and most of the time I found that they're even more annoying to code than C, D, E even thought they're easier. Is it because those problems have appeared frequently and red coders have solved all of them before ?
If you mean 1529B - Sifid and Strange Subsequences, even reds bricked while solving it in the testing phase ...
Record your contest and watch it again along with screencasts of the top contestants, and find the time you used to read the problem, find the solution and write the solution. Then you can see which step is significantly slower and note possible improvements. Also read the code other people write, and see how these code are shorter and easier to debug. Repeat this process for many problem/contests, and you will get faster.
By the time I am reading for initial problems : "Oh ok, n <= 1e5, I can kinda do a nlogn or some similar solution", red coder are already done by problem D :(
Damn. Great advice.
Reading code of top coders helps a lot. You can reduce your implementation time by a lot + practicing. When I started, it took me like 10 minutes to implement a binary search, but after observing demoralizer in some of his screencasts, I was able to work on that. And now I can code almost any variant of binary search in under 1-2 minutes.
This is a little funny because I believe I myself take a lot of time in implementing a binary search :)
I use your
low<=high
, and keeping a temporaryans
trick, saves me a lot of time on thinking about thelow<=high
part.Can you post any link for the trick.
I think you're wasting time by analyzing this (unless you already solved thousands of problems and you want to improve your approach a little bit).
But really watching you streams gives a real sense like how to approach a problem from basics. It is always easy to follow what you are saying since you never seems to be in any hurry!
Reading codes by others is educational. So is watching/hearing somebody's thought process. But analyzing your own performance will mainly show you that you're too slow and need to be faster :|