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

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

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
  • Проголосовать: не нравится

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

just solve more and more problems.

»
8 лет назад, # |
  Проголосовать: нравится +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.

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

    I do agree with this. But keep in mind to consider tricky cases if you choose not to read the whole question

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

    I think this is a wrong way.Many important information will be missed.

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

      I agree this is totally not the way specially if you're new. You'll end up missing a lot of info and just getting more stressful and anxious. What you need to improve is coding skills and not reading skills..... Coding can be improved by solving more and more problems.

      Get a stopwatch and record how long do you take to solve a problem A from the first read till AC and aim for getting it in less then 10 minutes. If you manage to do it, that's already great and it's time to move on to Div2 B and C.

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

      Ugh I just realized this blog is 3 years old...... why the fuck do people bump these :/

»
8 лет назад, # |
  Проголосовать: нравится 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.

»
8 лет назад, # |
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.

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

    How can you include personal code library without copy paste?

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

      combine all included files in my library by a script. also copy it to clipboard, or submit it directly.

  • »
    »
    8 лет назад, # ^ |
      Проголосовать: нравится 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.

    • »
      »
      »
      8 лет назад, # ^ |
      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 :)

    • »
      »
      »
      4 года назад, # ^ |
        Проголосовать: нравится 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!!!

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

also never ever use pow function in c ++