Skip to content

Commit

Permalink
Fix rounding error in contest_type: oi (#275)
Browse files Browse the repository at this point in the history
* Fix rounding error

* Fix display of 0 points

* Bump version

* Fix display again
  • Loading branch information
MasloMaslane authored Jan 7, 2025
1 parent 24d75fd commit 4b95bfb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/sinol_make/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from sinol_make.task_type.interactive import InteractiveTaskType # noqa


__version__ = "1.9.1"
__version__ = "1.9.2"


def configure_parsers():
Expand Down
2 changes: 1 addition & 1 deletion src/sinol_make/commands/run/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def print_group_seperator():
for program in program_group:
lang = package_util.get_file_lang(program)
result = all_results[program][package_util.get_group(test, task_id)][test]
if result.Points:
if result.Status != Status.PENDING:
print(colorize_points(int(result.Points), contest.min_score_per_test(),
contest.max_score_per_test()).ljust(13), end="")
else:
Expand Down
2 changes: 2 additions & 0 deletions src/sinol_make/contest_types/oi.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def get_test_score(self, result: ExecutionResult, time_limit, memory_limit):
"""
if result.Status != 'OK':
return 0
if result.Points == 0:
return 0
elif result.Time <= time_limit / 2.0:
return result.Points
else:
Expand Down

0 comments on commit 4b95bfb

Please sign in to comment.