Skip to content

Instantly share code, notes, and snippets.

@ssvb
Created December 2, 2021 22:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssvb/14a84068915136ebaa7d8af0101d8131 to your computer and use it in GitHub Desktop.
Save ssvb/14a84068915136ebaa7d8af0101d8131 to your computer and use it in GitHub Desktop.
codeforces ratings

The real starting rating is 1400 (but displayed as 0). Your rating delta after your first contest was -110 and your real rating changed to 1290 (displayed as 390). Your rating delta after your second contest was -43 and your real rating changed to 1247 (displayed as 697).

The following Python code can be used to convert your display rating to your real rating and the other way around:

def get_display_rating(real_rating, number_of_contests):
  if number_of_contests >= 6:
    return real_rating
  display_delta = [1400, 900, 550, 300, 150, 50]
  return real_rating - display_delta[number_of_contests]

def get_real_rating(display_rating, number_of_contests):
  if number_of_contests >= 6:
    return display_rating
  display_delta = [1400, 900, 550, 300, 150, 50]
  return display_rating + display_delta[number_of_contests]

print(get_real_rating(0, 0))
print(get_real_rating(390, 1))
print(get_real_rating(697, 2))

The difference between your display rating and your real rating becomes smaller after participating in more contests. And disappears after 6 contests. These 6 initial contests are necessary to ensure that your rating converges to your actual skill. This way you are not labelled as a "specialist" or "pupil" prematurely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment