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

kingofnumbers's blog

By kingofnumbers, history, 8 years ago, In English

note: this is just sarcastic blog

Here are the steps to follow in order to perform well in codeforces contests:

1- Have a fast internet connection: codeforces servers might be heavily loaded and be down, but during the down period the server might be up for short moments, and if you have fast connection you can catch theses moments and get chance to open the problems or submit your solution, also when you finsh coding a solution in the last minute you need fast connection to quickly submit

2- read all the old problems on codeforces: admins nowadays allow problems to be repeated or to be very similar to some old problem (or at least they don't take care to avoid that), so if you read all problems on codeforces (you don't have to solve them) you can know that a problem is repeated and copy/paste one of the solutions of the old problem, you might take some time to find the old problem but it can still be less time than to solve it.

3- practice your googling skills: sometimes the problem might be very classical and it can be found on google, sometimes it can be easily found and sometimes you need to try different wording to find it so you need to practice how to search on google.

4- don't forget about oeis.org: if the problem have a single integer in input you might find the solution in oeis.org

5- keep watching blogs and comments during the contest: admins nowadays don't remove comments and blogs (or at least they don't watch them) which spoil the solution of a problem, so if you keep watching the comments and blogs during the contest you might get a solution for free

6- try out brute force solutions before the contest end: it is very often that a contest contains at least one problem which allow brute force solution either because of genernous time limit or because of weak test data

7- get used to C++ if you are not: the time limit on codeforces is the same for all languages, so if you use fast language you will have advantage over the slow languages, specially when you try to write brute force solution as mentioned in previous step

8- keep with you templates of famous data structures and algorithms: sometimes a problem on codeforces is very easy to find the correct approach, but it just needs some well-known DS which takes a lot of time to implement so if you have it beforehand you might only need to do some trivial modifications before you are ready to submit

9- also you can practice your problem solving skills, but this is not very important step compared with all the steps above

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

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

Step 8 is not good advice. To use templates, you need to know which algorithm to use, which requires problem solving skills. Why should I have templates when I can just search for the solution in Google and copy it?

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

    this was for grey and green contestants ... don't bother yourself

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

    I'm agree with you. Never use your old codes for part of problem while you can just copy the whole solution.

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

    True. It's easy to break up something when you mess with templates, in special when you do it with poorly commented code!

    If you actually know from memory all invariants throughout the template, you're a short way from recording everything and then write it from scratch, which is just a better way to do things.

    I think most important is not the algorithm itself, but the toolset from which its construction is derived (e.g. recursion, recurrence relations, fundamental identities etc.). If you're used to an ample toolset, why bother with storing 1000's of templates?

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

note: this is just sarcastic comment

"Practice your googling skills" is the best one. If you figured out something in problem and all you have to do is like googling "making array increasing".

BTW, in some problems you can even skip the first part and just google the problem.

Googling is more important than know things.

Google it before you think.

Just google it.

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

People to follow during the contest: tweety Pepe.Chess abdurrahman.elgammal

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

    tweety's innocent :(

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

      you know you've got an amazing graph, I felt shameful when looking at it (:'()

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

- You red yet?
- No, dad. I'm 12.
- Talk to me when you red.

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

    what do you mean? I am just noob newbie and not allowed to complain? :D

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

      What complaints? I thought it's a blog with some advice only.

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

        so what did you mean?

        I'm complaining in sarcastic way, hoping after writing this blog the admins will do something to make only the 9th method important during the contest.

        • »
          »
          »
          »
          »
          8 years ago, # ^ |
          Rev. 2   Vote: I like it +57 Vote: I do not like it

          If you try to make a funny blog, expect others to try to write funny comments.

          Codeforces isn't perfect and it will never be. After the round you can express your feelings about problems (which you liked, which you didn't), what will affect future problems.

          Setters do make mistakes, especially if it's their first time. I don't think the situation is very bad in general. But I'm sure if someone wanted to voluntarily help with testing problems, CF staff would be happier and the round quality would be better.

          And a coordinator has so many things to care about (again: especially with new setters) that it's impossible to avoid mistakes.

          Sometimes an organizer tries to google a problem and doesn't succeed, it happens. Few involved people saying "I didn't see such a problem before" also makes the situation trickier. Also, even if there is more than one naive solution, maybe those solutions would be three times faster with unordered_map instead of map, or with recursive function replaced.

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

            If you try to make a funny blog, expect others to try to write funny comments

            I do expect funny comments, I just couldn't understand what do your funny comment imply so I asked you what do you mean and I just tried to make a guess with my question, that's it.

            Codeforces isn't perfect and it will never be.

            You are using the logic "Humans are not perfect and they make mistakes", ok I agree with this but I didn't make this blog when I for the first time see a mistake, not even for the second time, those mistakes became so frequent on codeforces so we can't use that logic as an excuse to a lot of mistakes, I believe with a bit more care the mistakes can be much less.

            coordinator has so many things to care about (again: especially with new setters) that it's impossible to avoid mistakes.

            Do you imply that all rounds have some mistakes? because actually it is not, there were a lot of perfect rounds here in CF.

            Also, even if there is more than one naive solution, maybe those solutions would be three times faster with unordered_map instead of map, or with recursive function replaced.

            This situation can be avoided by simply setting the constraints so that the brute force take more an 10s when the time limit is actually 2s (for example) in this case further optimizations will not let the brute force fit the time limit, but if the author is going to only write a brute force and see if it take TLE or not then he can't guarantee that doing some more optimizations will not make it fit the time limit.

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

              This situation can be avoided by simply setting the constraints so that the brute force take more an 10s when the time limit is actually 2s

              Well it is actually not always possible. Like if you want simple to run in 10s, then complicated intended for such constraints can run in 4-6s.

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

              Find "Family Guy you doctor yet" in the Internet.

              I also think that there would be fewer mistakes if organizers were more careful.

              "It's impossible to avoid mistakes" meant "sometimes they do happen because it's impossible to be sure about getting rid of them".

              I don't think that problem setters "only write a brute force and see if it take TLE or not". Also, your example with 10 seconds doesn't guarantee that nobody will solve a problem with that slower approach. And as adamant said, sometimes differences are quite tight. In some cases it's hard to say whether a problem can be used in the contest or not.

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

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

    Can I talk to you now? :)

    • »
      »
      »
      7 years ago, # ^ |
      Rev. 3   Vote: I like it +53 Vote: I do not like it

      you've become red just to write this comment haven't you ???

      :)

      • »
        »
        »
        »
        7 years ago, # ^ |
        Rev. 2   Vote: I like it +18 Vote: I do not like it

        Not only this, but also so that I can tell people to talk with me when they are red if I don't agree with their opinion :D

        just kidding :D

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

      *Waiting for Erricto to comment "Not yet" when you return back to yellow* :P

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

        No problem, if I reached it once I can reach it again :)

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

      Error 404 : Errichto Not found.

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

      Now he will say, "you problem-setter yet?" After you can do that he might be saying "You Mike yet?"

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

      Congratulations kingofnumbers! Sure we can talk now. By the way, are you red thanks to tips described in this blog?

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

        Thanks.

        Actually no, last contest I had 40 minutes left for problem E, and I spent it thinking of intended solution but I couldn't find it during the contest, while I could simply write naive solution O(N*A*B) and it turned out that it would pass the system test, so that means I didn't follow tip #6.

        As I said before, I did not intend to give tips for people, I intended to motivate admins to try harder to avoid those problems.

»
8 years ago, # |
Rev. 5   Vote: I like it +20 Vote: I do not like it

10. Hope contest is unrated, than you don't need anything previous, simply you will have good result :)

The worst thing — at most described is correct and it is not only some nice kind of sarcasm.

But from the other side, I really appreciate effort which made all this guys to prepare rounds and I know the most important things are fun and knowledge.

I had bigger rating before 2 years, I made a thousand stupid mistakes in last months + I feel all the same as you, but I am not planning to give up ! This is making my life nicer and more interesting, and I won't stop to do it, even I have rating lower than 0 or we have next 100 rounds unrated.

Everyone who doesn't have the same feeling must take a break, think how can spend average 4 hours per week during regular rounds and hope for bettr codeforces days :)

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

10- don't forget about online compilers: if you can't solve problem, see recent codes in online compilers, it is likely that you will find code to your task.

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

    I was going to mention that but I didn't because of 2 reasons: first, it is not CF admins fault. second, I didn't want to spread this method of cheating to people

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

If codeforces is so bad as you say then why do you participate in CF contests? Nobody obligates you.

  • »
    »
    8 years ago, # ^ |
    Rev. 2   Vote: I like it +87 Vote: I do not like it

    Codeforces is the worst online judge, except all others

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

Yeah, just sarcastic blog.

1 — Yes. If your internet connection is slow it is bad for you. It is admins fail too?

2 — YES. If you know many-many problems it will be much easier for you to solve new problems. It is hard work to read and remember all the problems on CF.

34 — There are many famous participants who use google to solve problems. You can do it too.

5 — Problem setter and admin have to answer all your stupid questions during the contest. Why should they monitor all the blogs? I can make a blog outside CF where I will post solutions. Or I can stream during the contest on YouTube or somewhere else. Admins should monitor this too?

6 — Why not? If you only have 10 minutes you can write some stupid or randomized solution. IT IS a good advise. However, on CF you can spend these 10 minutes trying to hack someone which might be better for you.

7 — You should use the language which is good for this particular purpose. You want check all the "out of bound" exceptions and use BigInt? — use Java. You want fast execution? — use C++.

8 — what is wrong with you? It is ACM. There exist very few algorithms that are frequently used. And yes, if you can copypaste flows, link-cut or FFT you will be faster. Again, I think that about a half top competitors use prewritten code. And all of them don't think that it is bad. I personally do not use prewritten code but I don't think that it is bad.

You were complaining about the admins and problem setters. Looks like you simply don't know how to participate in competitions successfully.

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

    Yeah they're all more important than the 9th one :(

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

      I prefer to use the 9th one, but there are some successful competitors who are not very good at math and problem solving (but still better than average yellow guy). Instead they know many problems and train very hard. The more problems you know the easier it become to find something familiar in a new problem.

      And one example for using prewritten code. You can reduce a problem to multiplication of two polynomials, there is no need to know FFT to do this. Now the problem is 'multiply two polynomials'. You know that it can be done using FFT. You can use prewritten FFT to do it. You don't have to know how FFT works.

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

        There are right and I don't think anyone have problems with those. I'm trying to say it's sarcastic blog but it doesn't mean they're wrong. They're true facts but they're not the best way for being good at it.

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

    Why so edgy ?

    Maybe he's had terrible times trying to increase his rating recently, so he though he'd do better on his contribution, he succeeded though :D

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

    You are defending CF rounds from all my points as if you are saying CF is just perfect and no need to make it better and it's OK to let brute force solutions pass and it's good if the problems are repeated and a lot of people copy/paste the solution.

    OK some of my points can be argued but some others are obvious fail in CF rounds.

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

If you want the admins to care about all these points then there would be just a few rounds per year(no more than 2 div2 rounds a month).

I think that CodeForces is the best community to learn from by reading editorials and discussions and making more rounds will help especially beginners to learn faster.

at last the problems gonna be repeated for sure because I think the space of possible problems is finite.

I know that you are right in some points but there is no better way to avoid these problems.

  • »
    »
    8 years ago, # ^ |
    Rev. 3   Vote: I like it +9 Vote: I do not like it

    If you want the admins to care about all these points then there would be just a few rounds per year(no more than 2 div2 rounds a month).

    in the past, the quality of the rounds were much better than now and they were even more frequent than now, so it's not impossible to increase both quality and frequency of CF round than they are now.

    I think that CodeForces is the best community to learn from by reading editorials and discussions and making more rounds will help especially beginners to learn faster.

    totally irrelevant.

    at last the problems gonna be repeated for sure because I think the space of possible problems is finite.

    I don't know if we can say they are finite, but I'm sure that not all of them are already used :D

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

      it is not irrelevant because my second point "I think that CodeForces is ..." is related to the first point "If you want the admins to ....." because I am trying to show the importance of increasing the number of rounds because in my first point I've considered that your suggestions will decrease the number of rounds.

  • »
    »
    8 years ago, # ^ |
    Rev. 2   Vote: I like it +2 Vote: I do not like it
    The space of possible problems is

    That is deep.
    I thought about it and my conclusion is that this number can be bounded by the number of atoms in the universe, which is around 10100. On the other hand, if we will use all that space to encode the problems, then we will not have space for our solutions.

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

      Since problems need to be written through words and the space of all finite sequences of words might be enumerated we already have an upperbound of the size of all possible problems set. I don't think it can be bounded by a finite number.

      Sort of demostration:

      Imagine some function , for example if a number is prime it goes True, otherwise it goes False. It can be proved that the cardinality of the set that contains all functions like this cannot be enumerated, but I can take a infinite enumerable subset.

      Here is the problem for you:

      Statement:

      How many numbers in the interval A, B satisfy condition S. Where S is (There is an infinite number of posibilities here).

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

There are around 4000 (rough estimate) problems on Codeforces. If you learn from all of them you definitely will to do better. At the end of the day given the size of problemset here ( and it keeps on growing ),its difficult for admins to verify if there exist problems with similar ideas.

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

It happened a lot of time and it will happen again that task is well-known or similar to some previous task.

Personally I had such situation as setter, and I would say that round was much more 'known' than this one, but again I think contest was ok and except at most 7-8 coders, for all other tasks were totally new.

After that everytime when I decide to prepare something I am thinking more than twice longer to be sure that I didn't see such task and someone else couldn't invent similar problem ( and from that all my prepared tasks from some rated round were new and nobody found something similar).

The point that setter should spend more time for finding similar tasks and thinking whether it is possible that someone before invented the same idea (in most cases it is easy to be seen — why someone would believe that nobody thought about increasing and decreasing elements by one for getting sorted sequence ?). The same story is for many queries tasks, tree tasks with dp solution or topics like palindromes, sortings, data-structures... Normally there si a lot of tasks which are not invented, but they need to be really creative...

As said before, I don't have problem with finding solution on google or known tasks, in every moment I had the same option to find it on internet. Maybe I couldn't find it, or I won't do that, anyway it is my problem and decision.

But to be honest, coordinators of all platforms should now at least for their platform whether some task is new or not. I think it is hard work for everybody, but in a 2-3 months it is possible to make some categories of tasks (for example at most 100 tasks with the same idea in one category ) and than searching for similar one would be much easier.

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

we have got one here

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

    Normally I would be annoyed at necroposting... but this is just too good. Thank you :P

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

I just feel like reviving this blog xD

But what actually happened here was kingofnumbers pissed or something?

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

Counter for all the advices. WA on pretest 3.

»
4 years ago, # |
Rev. 3   Vote: I like it -19 Vote: I do not like it

Has anyone ever used oeis.org in CF?

»
3 years ago, # |
  Vote: I like it -38 Vote: I do not like it

Hi, all. I want to create a contest. But I can't create it. Help me?

»
21 month(s) ago, # |
Rev. 4   Vote: I like it -13 Vote: I do not like it

10 — If you can DP it, then do it without any second thoughts. I use this tip a lot in div2BorC problems when they are actually asking for you to find a needle idea in a haystack of many, one time I wrote a 200MB+ DP solution just to avoid BFSing in the ideas graph. And I can guarantee an average +50delta in CF rounds for anyone using this trick.

Note that this tip is sarcastic, I don't like fast DP solvable problems, and neither needle in a haystack ones.

For anyone wondering why I'm spamming in an old blog, I did because it's a great one which is enough, additionally I feel sorry for not noticing it earlier and because it's still somehow valid for the time being, and actually I personally came up with most of those tips in CF even after starting CP many years after writing this blog.

And I'm waiting for a red+ contestant to underestimate me so I can use the hidden tip for reaching red quickly.

downvoters

  • »
    »
    21 month(s) ago, # ^ |
    Rev. 5   Vote: I like it -11 Vote: I do not like it

    I just noticed the massacre happing here, it seems that no one likes to have his "secret" way of succeeding on CF be spoiled for everyone else. Honestly, I feel bad for those poor people. Anyway, where there are downvoters there will be more upvoters! so feel free to express your opinion.

    another reason for downvoting me:

    FREE PALESTINE!!

    If you agree with me, have a look at the other comments and help fixing the situation here by upvoting some good comments.