File tree 2 files changed +15
-10
lines changed
2 files changed +15
-10
lines changed Original file line number Diff line number Diff line change 1
- #!/usr/bin/python
1
+ #!/usr/bin/env python3
2
2
# @author bl4de https://github.com/bl4de | https://ctftime.org/team/12769
3
3
#
4
4
# CTF event points -> CTFtime.org ranking points calculator
7
7
#
8
8
# Calculates team's points from CTF for CTFtime.org overall ranking
9
9
#
10
+ from math import floor
10
11
11
12
12
13
def calculate ():
@@ -16,17 +17,22 @@ def calculate():
16
17
place_coef = float (1 ) / team_place
17
18
18
19
if points_coef > 0 :
19
- rating = ((points_coef + place_coef ) * weight ) / (1 / (1 + (team_place / total_teams )))
20
+ rating = ((points_coef + place_coef ) * weight ) / \
21
+ (1 / (1 + (team_place / total_teams )))
20
22
21
23
return rating
22
24
25
+
23
26
if __name__ == '__main__' :
24
27
25
- team_place = int (raw_input ("your team place in CTF: " ))
26
- team_points = int (raw_input ("earned CTF points: " ))
27
- total_teams = int (raw_input ("teams with any points (more than 0) in CTF: " ))
28
- best_points = int (raw_input ("winner team points: " ))
29
- weight = int (raw_input ("CTF event rating weight (by CTFtime.org): " ))
28
+ team_place = int (input ("your team place in CTF: " ))
29
+ team_points = int (input ("earned CTF points: " ))
30
+ total_teams = int (
31
+ input ("teams with any points (more than 0) in CTF: " ))
32
+ best_points = int (input ("winner team points: " ))
33
+ weight = float (input ("CTF event rating weight (by CTFtime.org): " ))
34
+
35
+ weight = floor (weight )
30
36
31
- print " \n ### Your team earned {0:.3f} points in this CTF, congrats! ###" \
32
- . format ( calculate ())
37
+ print ( " \n Your team earned {0:.3f} points in this CTF, congrats!" . format (
38
+ calculate () ))
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments