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

MikeMirzayanov's blog

By MikeMirzayanov, 14 years ago, translation, In English

As some users have already noticed - contest rating has been added to Codeforces. For now it is in beta too, but it looks very adequate. Here's how it is calculated.

Each person is characterized by their rating, the number R. If person A's rating is RA, and person B's is equal to RB, then the formula


gives the probability that A will get a higher position than B in the round final standings. By the way, here everything is very close to the Elo rating.

Before updating your rating after the end of the round, for each participant his seed is calculated, that is the place that the participant is expected to take in this competition. Thus, two things are known for each participant - his seed (the expected place) and rank (the actual place). Depending on the difference between these two values, your rating increases or decreases. If the difference is higher, your rating changes more.

There are a few technical points:

  • if it is the first contest for a participant, his seed is calculated as 1 + n / 2, where n is the total number of participants in the round;
  • changes in the ranking of contestants are multiplied by a correction factor such that allows the sum of ratings of the participants to remain unchanged (before and after the round).

As at TopCoder all users are divided into two divisions: the first (rating over 1500 1650) and the second (rating_ not more than 1500 1650). Not rated users fall into the second division automatically.

Wish you high rating,  

MikeMirzayanov

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

| Write comment?
14 years ago, # |
  Vote: I like it 0 Vote: I do not like it
Would you introduce the possibility to see progress of each user? Especially the highest rating ever reached??
13 years ago, # |
Rev. 2   Vote: I like it +3 Vote: I do not like it
There are many comments in russian version that I don't understand and this subject is on the top of recent actions.
13 years ago, # |
  Vote: I like it 0 Vote: I do not like it
is number of rated contest each users joined before the current contest has some effect in rating system??
13 years ago, # |
  Vote: I like it 0 Vote: I do not like it
Could someone explain to me why is the use of the Elo Rating for the seed generation different of simply sorting the participants by rating?
  • 13 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    Say we had two people with the same (or very similar) rating. If we sort them, we will have to assign different seeds, which would give an unfair rating boost to the person seeded lower.

    Another example is the person seeded 1st. Elo rating's idea is to make expected rating change equal to 0 for every properly rated individual. However, a person seeded 1st will have a non-zero (quite large in practice) probability of losing rating (taking non-1st place) and zero probability of gaining rating (you can't go above 1st, can you?). This will make expected rating change for the highest-rated person always <0, showing that he is not properly rated.
»
12 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Division boundary is actually 1700 as described in FAQ.

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

Can you please update this post with the currently used formulas? I want to know how do you calculate the ratings, is it possible to publish something like this?

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

How is country rating computed?

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

How do the system calculate the seed of a participant ?

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

If a Division 1 person participates in Division 2 competition , obviously "out of competition" , then obviously he/she will not figure in rank list , but will the RATING change based on performance or not ???

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

    Rating for out of competition participants does not change.

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

      I believe he meant this: Does the performance of out-of-competition guys effect the changes in the rating of the Div2 guys?

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

    No. All the rating changes will be the same as if the "out of competition" guys didn't participate at all.

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

Could you please provide more data with final standings of a contest? If we had at least rating before and after the contest, it would be quite comfortable. Currently it's hard to download these values.

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

why there is no overall rank based on ratings.

»
11 years ago, # |
  Vote: I like it -17 Vote: I do not like it

I think rank should be displayed on homepage.

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

i suggest u update the border of Div-1 and Div-2 to 1700.

EDIT: i was just trying to help. i dont think this post should have got so many downvotes!

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

    I think you got the down votes because you asked Mike to change the rules of another website, topcoder. You also didn't provide any reasons for this change.

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

      No. I believe everyone who down voted him had thaught like you.

      Read the blog once more... and you will find out this :

      As at TopCoder all users are divided into two divisions: the first (rating over 1500 1650) and the second (rating not more than 1500 1650)._

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

    up vote

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

I don't understand. The expected rank is calculated with 2 people ' rating? For example, if I'm person A with rating 1371. And my actual place is 300. Then who will be person B?

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

    As I've understood, by this formula server counts probability that you'll be better than other participant for each one. By this probabilities we can count your approximate place(seed), then get your real place(rank) and find change of rate, based on them.

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

New account have participate in Codeforces round — http://codeforces.com/contests/with/hujub , and gain 1494 (-6) rating and became green. But in results table he/she lost only to 4 greens, and win against hundreds of blues+purples. It is mystical for me, why he become green, not blue or purple? For example next (432nd) place (purple participant) increased his rating 1714 -> 1727. Is it fair?

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

    When you are participating first time, your expected position (seed in terms of this post) is n/2+1

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

How is every users's seed (expected rank) calculated? Can you add an option to Codeforces that will tell the contestant what rank is he/she expected to take?

Is this seed calculated according to the last match?

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

    if this feature is implemented, i suggest that this is only available after the contest.
    if available before contest, this knowledge can play with our emotions and possibly make us a bit slower for rest of the contest.

    • »
      »
      »
      10 years ago, # ^ |
      Rev. 3   Vote: I like it 0 Vote: I do not like it

      You don't get main idea of Elo-based ratings. Elo ratings of players have following property: if some set of players will now participate in the contest then expected order of final standings (more formally, most probable permutaiton in some sense) is exactly the order of decreasing of their ratings.

      So, this feature is already implemented. Just look on the list of registered users before the contest and sort them by rating in descending order. Your position in this list shows your expected position in the contest.

      UPD: Nevermind, I suck at Elo-based ratings =(

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

        This is not correct:) Your expected position depends not only on your position in list, sorted by rating, but also on all other ratings.

        If top1 has rating 3000, and all other contestants have rating 1000, then his (top1) expected place is very close to 1.0. But if top1 has rating 3000, and all other have rating 2999, then I am not so sure that top1 will win this contest:) And his expected place is actually close to n/2:)

        You proposed easy approach to calculate expected position in standings, but it is not right Elo-based way. BTW, tourist can never get + rating for 2nd place with this approach, because his expected place will be 1st:)

        To get correct expected place one should calculate Elo-based probabilities of losing versus every other contestant and add these values (and also add 1 to result, because standings are 1-based).

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

          =( Yes, second example shows that I'm completely wrong about expected place, sorry.

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

As at TopCoder all users are divided into two divisions: the first (rating over 1650) and the second (rating_ not more than 1650). Not rated users fall into the second division automatically.

MikeMirzayanov , it should be 1700.

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

    exactly what i meant in my comment.

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

      I don't know why you got so much downvote in that comment . it makes no sense . i didn't see your comment before . i just gave a upvote . but what can just a little upvote do against 61 downvotes ? :(

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

umm.. can you please tell me how you calculate change in rating after a contest on the basis of his standing?

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

    Rating formulas aren't public in CF. And even if you would have them, I doubt you could calculate rating change faster than CF servers would do. It's a quite heavy operation, I think.

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

What is a reason for leaving rating unchanged of guys who have registered for a contest but do not make any submissions? Is that because people may not handle with time and just late for the contest? Come on, really? I suppose majority of people are not so silly. Also, they can register right before the contest if they decide to participate. In addition, it's normal in sports people get the worst results if they ignore the contest they are registered for.

However, it provides ways for cheating. For example:

  • register for contest
  • try to solve C(or even more complicated problem, depending on level)
  • if C is solved and participant is sure it will be accepted:
    • submit C
    • solve A and B
    • get a lot of rating
  • else:
    • do not submit anything

Results: lots of rating in best cases and nothing in worst ones => expected value of rating is more than actual level.

Proof: in Codeforces Round 286 (Div. 1) problem A was relatively complicated. As a result, more than usual number of out-of-participation guys was even mentioned in editorial.

Guys, you all believe that one half of people registered for all div 2 contests do not participate because they are late for them? It's ridiculous. I suppose, most of them do not have an evil plan like described above but they just find problems complicated and decide do not risk that is unfair too.

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

    Strongly agree with you: "take a look at the problems => welcome to the standings"
    It's the ancient problem.
    Several month ago, it was interesting for me to analyze registered vs participated vs notParticipated vs isOnline lists in Div1. As a result, there were many participants, who registered, was online during at least half of the contest, but not participated.

  • »
    »
    9 years ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    agree , i think a good alternative is TC system , the timer start counting when you open the problem and if you opened any problem your rating will be changed .

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

      Yes , but this might encourage cheating . 1) Register another account 2) Login & enter DIV.2 contest 3) Read DIV2-C .. DIV2-E problems 4) Decide, login main account or not

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

        One of best ways to prevent cheating is rating penalties for registered coders if they do not submitting anything. Not cruel, approx. -10 pts. If there is coder that cannot take part and unable to unregister because of force majeure, this one-time penalty will not affect seriously, but if coder try to cheat, he will receive this penalty regularly, time after time, losing rating points. Also, more cheaters -> more penalties -> more rating boost for non-cheating coders, because sum of ratings before and after contest is constant.

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

          In my opinion, it's an extremely unefficient solution because benefit of cheating in average is much greater than 10 pts. I suppose the best way is consider all the registered coders participating. Why? TC system may not work here because problems are shared for both divs. I think people who feel force majeure may happen should register right before the contest. In fact, they even can do it all the time :) Also, one failed contest due to time management issues per long peroid(in fact, in contest a lot of other bad luck cases may happen) will not ruin your rating completely because Elo-based system "helps" you to grow if your rating is less than actual level.

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

I solved a problem in "Codeforces Round #332 (Div. 2)", but my rating is not changed.... Would you please let me know why it happens?

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

    it takes about two hours after the contest to get the rating change

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

I'm new in codeforces. today i solved one problem . after the round i checked my profile and saw "Unrated" why ?

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

    Hi. Rating hasn't been updated, so wait a little.

»
7 years ago, # |
  Vote: I like it -18 Vote: I do not like it

.

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

Hi. Today i solved one problem in a contest. But my rating still shows Unrated. Why?

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

    Ratings usually take a few hours to be updated. Please be a little patient :)

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

I recently appeared a contest and solved one problem but my profile isn't reflecting the contest details I. e., my profile is showing that I haven't yet appeared for any contest

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

    That contest that you took part in was made unrated, check the round announcement.

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

What if you take a virtual contests? do you get any rating?

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

I participated in the Codeforces Round #586. I solved one problem A and all the pretests were accepted. Then I tried to solve Problem-B,But failed in one of the test-cases. After evaluation was done, I got to know that my code was accepted and I got 366 as my score for the problem. Though, there was a '-1' for Problem-B. I thought my rating would have got increased a little, atleast. But instead, it got decreased. A '-74' in my rating. Can you tell me why this happened? And Where did the 366 I scored go?

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

    The sum of points in all the problems is used to sort the participants and form the ranking. Your rating change is calculated based solely in your position in the ranking and the expected position according to the rating you had before the contest.

    I.e. the points you get per problem are discarded after the ranking is formed.

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

It seems that the system has been updated, and now the sum of ratings decreases after contests. For example, in Codeforces Round 564 (Div. 1), the total rating delta is -969.

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

my rating is 423 after giving 1 contest . Is that fine ?

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

Does the average rating stays around a exact number?

Or in other words, is $$$\Sigma\Delta$$$ in each round around 0?

I'm new in codeforces :)

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

    Jesus fucking christ don’t fucking necropost a 10 year old blog if there’s a much more recent one discussing ratings.

    New to codeforces isn’t a fucking excuse because every single fucking forum discourages necroposting.

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

      But does Codeforces discourage it? I don't think so.

      Also, when you are new to a site like this, how does he even find the newer blog.

      He probably just googled some keywords, stumbled on this blog, and commented. You are discouraging a newcomer to the site, just because he commented on a blog you didn't even own, you are too lazy to answer him but too eager to trash talk.

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

I achieved rating 443 after my first contest global round 8 in with held yesterday but my friends started with initial rating of about 1500 but for me it was 0. Why?

»
2 years ago, # |
Rev. 2   Vote: I like it -20 Vote: I do not like it

1

»
23 months ago, # |
Rev. 3   Vote: I like it +2 Vote: I do not like it

"if the participant A had worse rating than the participant B before the contest and finished the contest on the worse place then after recalculations the the rating of A can’t be greater than the rating of B". Then can someone please explain to me how Honey_Cheerios got a higher rating than Ravsteel even though the former had a lower rating than the latter and both finished with the same rank in Codeforces Round 781?

  • »
    »
    23 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    this blog is 12 years old.....

    Also, you get a bonus rating just for participating in your first 6 contests. Which sums up to 1400 or 1500.

»
15 months ago, # |
Rev. 8   Vote: I like it -37 Vote: I do not like it

Good Luck Guys<3

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

Is there an query in api for getting current cf rank(current rating based rank)

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

Do we get rating by participating in Gym?

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

That's CRAZY! This blog was written 14 years ago!