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

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

Hi, Sorry if this is newbie question, but I solved some easiest problem in codeforces, and i wonder, how can i improve my speed to solve these problem? i don't know what to do to improve my speed, should i learn some algorithms to increase my speed? Thanks.

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

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

just solve more and more problems.

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

Learn to find the fact without read the whole problem statement,

For example, you can read from the input part, and find what the meaning of N, M, X, etc. Once you understand the problem and got the solution, code your solution as fast as you can.

N.B. I think it'll only work for problem A, or sometimes problem B. But it depends on your strength.

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

If you are trying to solve div 2 A problems the algorithms provided in and STL containers should be sufficient. However once you start solving div 2 B or div 1 A you will need some additional algorithms for working with graphs certain problems as well as others for other situations.

»
9 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +10 Проголосовать: не нравится

Some tricks:

  1. test crawler : parse sample test cases from web page. No copy'n'paste any more.

  2. test script : diff your output with expected output

  3. turn on more compiler warnings

  4. useful shorthands in your template

  5. a standard code library: it can be included like standard library without copy'n'pate.

  6. start coding only after you have clear idea. Otherwise you will waste time to change your code frequently and debug.

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

    How can you include personal code library without copy paste?

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

    Advises 3 and 6 are very reasonable, but I don't think any of those will increase your skills in the long run. If you want to be better, just solve many problems.

    • »
      »
      »
      9 лет назад, скрыть # ^ |
      Rev. 2  
      Проголосовать: нравится 0 Проголосовать: не нравится

      Sure. These are just some competitive programming tricks.

      But when I stop wasting time in these useless labour (copy test cases / diff by eye / debug / write the same code again and again), I can solve more problems :)

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

      I am now able to solve problems up to div2 D level 1800-1900 rated but i m very slow can you plz suggest what should i do currently i used to solve Div2 D daily like 10-12 problem daily of codeforces should i continue this or should i jump to other websites like atcoder,topcoder,codechef i m familiar with codechef, i found topcoder's environment too complicated for my stupid ass, and i didn't tried atcoder yet!!! THANX IN ADVANCED LIKE IF YOU EVER REPLY TO MY COMMENT!!1 THANK YOU!!! Errichto can you also plz make a video for someone like me i found ur videos quite good!!!

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

also never ever use pow function in c ++