I have seen manytimes, that the winner of a Div 2 contest has solved both the A and B problems in less than 6 minutes. How is that done? You have to read, think and implement a question. Unless it's answer is a single line, it takes some time to implement a solution. I tried to solve a series of Div 2 B questions to increase my speed, and if the solution is obvious it takes me approximately 6-7 minutes, and otherwise 11-12 minutes.
I know that these people have a lot of practise, but is there any other tip they can share so that I (and other people like me) can improve our speed in contests?
My solving procedure: 1. Read 2. Think, come to a solution (ummm, obviously)
I do not use a template. I include #include<bits/stdc++.h>
library. Then I do a using namespace std;
. Then since writing for
loop many times takes time, I define a macro like #define f(i,s,n) for(int i=s;i<n;i++)
. And then I start implementing. Since these questions are much easier, we mostly don't need another method.
Do templates save time here? Is there any other improvement I can make?
Any suggestions are welcome :)
Practice + Fast typing speed + template + Not reading the whole story of the problem (In case possible).
you could try creating a mashup contest with a lot of Div2 A problems, and try different methods, and measure your performance.
Great advise! Thanks!
Don't focus on that, one extra problem for you is way better than being 5 minutes faster in easy problems.
Actually that is my intention. I have seen that I can solve C and sometimes D, but there just isn't enough time. A and B take 20-25 minutes. That leaves much less time for C and D.
If you focus on improving solving in general, you'll get faster at solving those problems naturally. If I were to give you an advice, try to reflect on why you take that long on solving these problems instead of solving more problems (sometimes at least). Maybe look at code from other participants to find tricks on how to make code simpler or shorter. All that comes with time if you practice enough.
Aye aye cap'n.