From 6c87f8c7b8cf1ec151223af94bfc13dec9095cc1 Mon Sep 17 00:00:00 2001 From: Extra-Creativity <72960952+Extra-Creativity@users.noreply.github.com> Date: Wed, 24 Apr 2024 16:09:17 +0800 Subject: [PATCH] Update judge.py --- src/judge.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/judge.py b/src/judge.py index bf36ac3..ef3afbd 100644 --- a/src/judge.py +++ b/src/judge.py @@ -106,13 +106,14 @@ def test(path: str, case: Union[Case, MalformedCase]) -> JudgeResult: if output_in_memory != case.expect_output: to_end = True + i = 0 for i in range(min(len(output_in_memory), len(case.expect_output))): if output_in_memory[i] != case.expect_output[i]: to_end = False break def get_char_or_eof(s, idx): - if to_end and idx + 1 == len(s): + if to_end and idx + 1 >= len(s): return "" return s[idx]