Skip to content

Commit

Permalink
Merge pull request #201 from th-ch/skasch/fix-49-stars-leaderboard
Browse files Browse the repository at this point in the history
Fix 50th star for leaderboard
  • Loading branch information
skasch authored Dec 28, 2023
2 parents 5a6673c + f6e5b44 commit 949ac70
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tool/leaderboard/leaderboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ def aggregate_author_results(
)
for results_by_part in results_by_day_and_part:
for results in results_by_part:
# Ignore day 25 part 2, which is given if all 49 other problems were
# solved
if not results or (
results[0].problem.day == 25 and results[0].problem.part == 2
):
continue
best_result_by_author: dict[str, Result] = {}
for result in results:
author = result.submission.author
Expand All @@ -71,7 +77,10 @@ def aggregate_author_results(
return sorted(
(
AggregatedAuthorResult(
author, sorted(c.languages), c.stars, c.total_execution_time
author,
sorted(c.languages),
50 if c.stars == 49 else c.stars,
c.total_execution_time,
)
for author, c in results_by_author.items()
),
Expand Down

0 comments on commit 949ac70

Please sign in to comment.