$ cd ../
$ cat /backups/brain/
0037
CTFTime Rating Calculations

Here’s the CTFTime Rating calculations for 2025, they don’t match the official documentation as its not updated but they perfectly predict the given rating points.

Calculations

Formula: (p/b + 1/t) * w

  • p is the points of your team
  • b is the points of the first team
  • t is the position of your team
  • w is the rating of the CTF

Remarks

  • At maximum you can get 2*w as points from a CTF

    • w for being the first team in the CTF
    • w for getting the same points as the first team (in case of tie)
  • You get points from two things (formula below):

    • Team points compared to first team (ratio, maximum 1)
    • Team position in leaderboard (ratio, maximum 1)

Formula: w dot p/b + w dot 1/t

CTFTime Team Rating

Add the 10 highest CTF Rating Points for the team during a period (during the current year)

and, if you organized a CTF, then you add 2*w to your rating sum (not completely sure, TODO)

Time window note from CTFTime:

time window of 18 months used b/c event time can shift within a year.

Original Calculations Typst source

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
== CTF Rating Points

$
(p/b + 1/t) * w
$

- $p$ is the points of your team
- $b$ is the points of the first team
- $t$ is the position of your team
- $w$ is the rating of the CTF

=== Remarks

- At maximum you can get $2*w$ as points from a CTF
  - $w$ for being the first team in the CTF
  - $w$ for getting the same points as the first team (in case of tie)

- You get points from two things (formula below):
  - Team points compared to first team (ratio, maximum $1$)
  - Team position in leaderboard (ratio, maximum $1$)

$
w * p/b + w * 1/t
$

- A high rating CTF that its easy (and gets full cleared) gives a lot of points (more than $w$)
  - Usually it will get downvoted to lower the rating for next year
  - See https://ctftime.org/event/2641

== CTFTime Team Rating

Add the $10$ highest CTF Rating Points for the team during a period (during the
current year)

and, if you organized a CTF, then you add $2 dot w$ to your rating sum (not documented)

Time window note from CTFTime:

> time window of 18 months used b/c event time can shift within a year.

== Calculator

```py
#!/usr/bin/env -S uv run --script

from math import floor

# Get user inputs
team_points = float(input("[>] Team points: "))
best_points = float(input("[>] Best points: "))
team_place = float(input("[>] Team place: "))
total_teams = float(input("[>] Total teams: "))
weight = float(input("[>] Weight: "))

# Calculate coefficients
points_coef = team_points / best_points
place_coef = 1 / team_place

# Calculate and display rating
if points_coef > 0:
  e_rating = (points_coef + place_coef) * weight
  print(f"[+] Final rating: {e_rating:.3f}")
  print(f"Part of points:    {points_coef * weight}")
  print(f"Part of placement: {place_coef  * weight}")
else:
  print("[!] No points")
$ cd ../