When submitting a solution in C++, please select either C++14 (GCC 6-32) or C++17 (GCC 7-32) as your compiler. ×

low_'s blog

By low_, 6 years ago, In English

Recently, I've successfully promoted to become a candidate master on Codeforces, which is one of my target this year. And to celebrate this, here is my first blog on Codeforces.

Climbing ranks on Codeforces takes time (unless if you known the platform and the contests well in the first place). During that time, by pushing yourself to climb to your target ratings, you might find out that you learned a lot. E.g.: more efficient coding skills and strategies, more cohesive thinking and more creative algorithms or uses of data structures,.... That's why I always tell myself that decreasing of ratings is okay, as long as you learned something after *that* contest. That's the first tips on climbing: To have a positive mindset.

I heard some avoids rating decrease by violating contest rules (for example: submitting others' codes) and get a "skip" after the system calculating rating changes. I think this is not showing the sportsmanship and fairness when participating in a contest. And by doing this, you might learn nothing after the contest and participating can be a total waste of time. In the near future, I hope that Codeforces headquaters could be stricter towards plagiarism and punish those who try to violate contest rules as well.

Put them aside, here are the other tips:

1, Before the contest

  • Prepare: water for hydrating, pen and A LOT OF paper for drafting. Also don't forget to go to the toilet 15 or 30 mins prior to the contest. 5 to 10 mins AFK during the contest could decide your whole contest outcomes.

  • Utilize your contesting condition by altering the room temperature: according to my Math teacher, 19-24 degree Celsius is the most ideal to focus on your work.

  • Clean up your surroundings: you might not want to work in a messy room, it can be very uncomfortable during the 2-hour (or more) focusing.

  • Make sure nothing could distract you during the contest: turn off your phone, log out of Facebook. During the contest the only thing should be on your PC is Codeforces tabs and the IDE.

  • Be as relaxed as possible: take a shower, wash your face, play a game of League, have a cup of milk, ... anything to free your mind before the contest.

2, During the contest:

  • Keep focus on nothing but the tasks.

  • REMEMBER: quality must be prioritized more than quantity. You might be slower than your fellow programmer on some task, but in the end, you may stand higher than him or her because your code is accepted and his/her code is hacked/failed system testing. Test your code carefully with pure Brute-force code that 100% yields correct answer (and 100% will exceed the time limit)

  • Some contest which has task D easier than task C (e.g.: Codeforces Round 492 (Div. 2) [Thanks, uDebug!]). You can identify what to do next by either skim through several tasks at the same time or check the standings and submission counts (This is not recommended to do too often during the contest!).

  • Use draft paper on some maths-or-geometry-involved tasks. You might want to put down different formulae or algorithms on your paper and keep track of it during your flow of thoughts.

  • MY STRATEGY (for reference only): Rush through A and B in the first 15~20 minutes (beware of "traps" in the task statements and pretests). Read C and D (sometimes E) to identify what to do next and after that. Check the standings seldomly, and dedicate the last 30 minutes focusing on one task only, not jumping between 2 or more at the same time.

3, After the contest:

  • Contact your Code-mates and discuss on the tasks: This could help you better understanding the tasks and your own code. Listen to a different approach can be very interesting as well.

  • Check the editorial: try to follow it. If some tasks are too hard, you can skip them, but it is recommended that you try your best to understand it.

On the long run, I find code-mates make me become more competitive and always push myself harder contests after contests. I learned a lot from them, better understand different approaches to the tasks and makes the contests more enjoyable. I think the criteria to find a code-mate varies for each person, but one point is that one have to be passionate and easy to talk to, in order to help you become better.

Last few words, huge thanks to my three code-mates: _nthoang_ (just 4 days before me), Dragon_Fly_02 (on the same contest with me), and Necrozma (really, really close). All three, though 1 year younger than me ( As the publishing of this blog, I'm 17 ), have been incredible in the past few months. We exchanged a lot, and I learned a lot from discussions with them. Nec was very unlucky in the last contest and missed his chance of promoting, but with his passion and intelligence, the day he became the third "purple" coder in our school Informatics team isn't far away.

That's all, now I'll go back to study and take out trash in the next year Hanoi VOI team :p

  • Vote: I like it
  • +44
  • Vote: I do not like it

| Write comment?
»
6 years ago, # |
  Vote: I like it +1 Vote: I do not like it

Auto comment: topic has been updated by low_ (previous revision, new revision, compare).

»
6 years ago, # |
  Vote: I like it +15 Vote: I do not like it

I do nothing from "before the contest" tips. They are useless.

  • »
    »
    6 years ago, # ^ |
      Vote: I like it -10 Vote: I do not like it

    agree. I tried similar things in the past and I always did worse. Maybe it works for some people.

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +18 Vote: I do not like it

    Well, those are just for reference :)) but it works for me

»
6 years ago, # |
  Vote: I like it +86 Vote: I do not like it

Does drinking milk make you relaxed?

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +8 Vote: I do not like it

    Do you have lactose intolerance?

  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Sometimes. Most of the times I use soft drinks. But what I said in this blog are just suggestions!

»
6 years ago, # |
  Vote: I like it +6 Vote: I do not like it

Very nice write. :D Good luck to you and your future endeavour.

»
6 years ago, # |
  Vote: I like it -63 Vote: I do not like it

My tip: during the contest you should masturbate one or two times. It really helps me.

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +154 Vote: I do not like it

    My tip: during the contest you should solve problems. It really helps me.

  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Your mind will be distracted so how does it help? Also, you lose energy so how will the contest go good? You don't want others to become yellow like you?

    • »
      »
      »
      6 years ago, # ^ |
        Vote: I like it -16 Vote: I do not like it

      Or mayyyybe, he isn't distracted :/ Maybe he is "penetrating" the problems with his mind and that does it for him, or something, I don't know.

»
6 years ago, # |
  Vote: I like it +6 Vote: I do not like it

Congratulations. My advice is don't bother looking at standings during the contest, it only slows you down. Imo, the only useful thing is to check how many people have solved each problem, to know if a D is actually easier than a C or similar.

And of course, read tutorials, ask questions, upsolve. The helpful community interaction is what sets codeforces apart.

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +19 Vote: I do not like it

    Thanks for the advice. During the contest, I often look at my friend standing, whom at the same level as me. If I'm behind them on some problem, I'll try to push myself to solve that.

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +16 Vote: I do not like it

    I kindly disagree. My friend once solve a problem because he saw that I solve a slightly harder problem, and he thought that if I could solve it, it can't be that hard, and therefore he managed to solve it. I think there's no point to keep looking at the scoreboard, but if you have completed a problem and you are not sure which to solve, the scoreboard might provide you with some information.

    • »
      »
      »
      6 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I get where you're coming from. If one problem has a lot of people solving it early on, I might skip to that one to see if I can do it.

      At the same time, personally I can get easily frustrated if I feel like I "should" be able to solve a problem but I'm not quite getting it, so for me, it's easier to focus and not get distracted by how others are doing until after the contest.

»
6 years ago, # |
  Vote: I like it +4 Vote: I do not like it

Where to find a code mate

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    It is advised that you find them in your own school/institution that is at the same level as yours. If you cannot find one, you can look for them on programming forums/platforms like codeforces or hackerrank, but communicating will be a much harder challenge.

    • »
      »
      »
      6 years ago, # ^ |
        Vote: I like it +4 Vote: I do not like it

      how to find them on CF? -_-

      • »
        »
        »
        »
        6 years ago, # ^ |
          Vote: I like it +8 Vote: I do not like it

        After some contest, you can look around the standings and the comment section in that contest editorial. You might find someone on your level and code the same language as yours. Send them a message!

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Very Nice Blog.Tips are very good it will helpful for me.Thanks <3.

  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    No problem! It is great to see that I can help the community.

»
6 years ago, # |
Rev. 2   Vote: I like it +50 Vote: I do not like it

Always writing a brute-force sounds horrible. If I had to do that, I'd only have time to do 1, maybe 2 problems per round. You should only write brute force if you get WA or hacked and can't find the bug, or maybe in some super special cases, like if you no longer have time to do any other problems, and even then I'd rather do hacking.

You also don't mention upsolving which I feel is the most important part for improving. If you couldn't solve a problem, you should try to solve it after the contest, not just immediately spoil yourself with the editorial.

Also one important thing is to get used to competing, and as such not being as nervous during contests. This you can of course do by participating in as many contests as possible. Additionally, since being nervous can really hurt your performance, I feel like preparing for a contest like you suggest does more harm than good, since preparing makes (at least me) more nervous.

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +7 Vote: I do not like it

    I do agree! But if you got used to it, a brute-force code may only take you about less than 10 minutes and make sure that your code is 100% accepted. (I tried to use brute-force to test most of my codes for a couple of months, and after 1 and a half month, I can write one in just 5 minutes)

    And yes, I forgot to mention that you should only read the editorial only after you brainstormed on a particular task for at least 30 to 60 minutes and not having a single clue of how to get "accepted". Sorry about this!

    Also, may I clarify that this blog entry is just for reference. It is advisable that you find your best method of studying on your own to climb ranks.

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      30-60 minutes? More like 3-6 days dude.

»
6 years ago, # |
  Vote: I like it +2 Vote: I do not like it

When you're practising, do you practise problems from CodeForces or use other judges for practice ?

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +6 Vote: I do not like it

    I use multiple platforms to practice, including SPOJ, CodeChef and Codeforces.

    • »
      »
      »
      6 years ago, # ^ |
        Vote: I like it +2 Vote: I do not like it

      Do you use AtCoder or CS Academy ?

      • »
        »
        »
        »
        6 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        No, currently. But I may try them in the future.

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I can't find editorials of contests. Someone please help.

  • »
    »
    6 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Check the Contest material section in the contest main page. They usually put a link to the tutorial blog there.

»
6 years ago, # |
  Vote: I like it 0 Vote: I do not like it

This was really helpful! Thanks a lot :D

»
6 years ago, # |
  Vote: I like it +37 Vote: I do not like it

"Be as relaxed as possible: play a game of League" — nice joke you got here.

  • »
    »
    6 years ago, # ^ |
      Vote: I like it +3 Vote: I do not like it

    Haha :))) those example are just for reference. One time I "ARAM and chill" with my friends before the contest and got into top 100 that day.

    But if you are a toxic player and usually become stressed after playing, gaming is highly NOT recommended before contest!

»
4 years ago, # |
  Vote: I like it +18 Vote: I do not like it

On a deeper level:

  1. Sometimes trust your instinct. Most of the times, it takes significant effort and maths to prove an idea/algorithm, but with your instinct you can immediately sense the credibility of the idea, jump directly to the coding and save a lot of time. This is why learning maths is important, both for having enough knowledge to prove your algorithm and for instinctively knowing that your algorithm make good sense.

  2. Try to overcome the "anchor effect": when you go far enough with your train of thoughts but get stucked, it is hard to forget all and do it over. This is the anchor effect. It wastes a lot of time and blocks your mind from other ideas. So try to overcome it.

  3. Seriously codeforces isn't life. So all goals like "reaching Candidate Master in 10 contests" and "place higher than tourist in at least 2 rounds", I think, are useless. Aim something useful, like "a gold medal in IOI", "get into ICPC World Final" or "get an internship at Google". I realize when you focus on sensible goals, codeforces will become a more correct reflection of your ability and progress. For example, my friend low_ aimed for a national prize and a chance to compete in Vietnam IOI selection contest. Guess what? He got a national prize, a place in Vietnam APIO team, and he reached Master in the same year. So training codeforces was totally useful for him to achieve his targets, and his rating was an accurate indicator of his talent and efforts.

Final words: I don't know why this blog popped up, I decided to add my own experience to make it more useful.

»
4 years ago, # |
  Vote: I like it +1 Vote: I do not like it

Looking for code-mates to dsicuss probelms after the contest?