Блог пользователя Mooncrater

Автор Mooncrater, история, 6 лет назад, По-английски

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 :)

  • Проголосовать: нравится
  • -18
  • Проголосовать: не нравится

»
6 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Practice + Fast typing speed + template + Not reading the whole story of the problem (In case possible).

»
6 лет назад, скрыть # |
 
Проголосовать: нравится +9 Проголосовать: не нравится
  • sometimes it's not necessary to read the whole statement, just read the input/output sections (try this at your own risk, it's not always good).
  • if it's an easy problem and you are sure of your code, don't waste time compiling and testing (submit at your own risk without even compiling).
  • use some external tools like Hightail for automatic testing, it helps a lot.
  • of course pre-written template helps a lot (minimize the #of keystrokes).

you could try creating a mashup contest with a lot of Div2 A problems, and try different methods, and measure your performance.

»
6 лет назад, скрыть # |
 
Проголосовать: нравится +41 Проголосовать: не нравится

Don't focus on that, one extra problem for you is way better than being 5 minutes faster in easy problems.