From 4b95bfb567c79e09bb6ddf65dbaa0afef03f6124 Mon Sep 17 00:00:00 2001 From: Mateusz Masiarz Date: Tue, 7 Jan 2025 16:49:55 +0100 Subject: [PATCH] Fix rounding error in `contest_type: oi` (#275) * Fix rounding error * Fix display of 0 points * Bump version * Fix display again --- src/sinol_make/__init__.py | 2 +- src/sinol_make/commands/run/__init__.py | 2 +- src/sinol_make/contest_types/oi.py | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sinol_make/__init__.py b/src/sinol_make/__init__.py index 07020164..c02bbbbc 100644 --- a/src/sinol_make/__init__.py +++ b/src/sinol_make/__init__.py @@ -12,7 +12,7 @@ from sinol_make.task_type.interactive import InteractiveTaskType # noqa -__version__ = "1.9.1" +__version__ = "1.9.2" def configure_parsers(): diff --git a/src/sinol_make/commands/run/__init__.py b/src/sinol_make/commands/run/__init__.py index 81f673c9..1ce6efc7 100644 --- a/src/sinol_make/commands/run/__init__.py +++ b/src/sinol_make/commands/run/__init__.py @@ -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: diff --git a/src/sinol_make/contest_types/oi.py b/src/sinol_make/contest_types/oi.py index dd5e4444..e0520741 100644 --- a/src/sinol_make/contest_types/oi.py +++ b/src/sinol_make/contest_types/oi.py @@ -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: