Skip to content

Commit fc968e2

Browse files
committed
If the validator of a combined run/compare script exits first with WA, override TLE.
See Kattis/problemtools#77 for an in-depth discussion. With this, all test submissions of the example guess problem give the expected answer, but we need to do some cleanup and UI/import changes before we can close #465.
1 parent 8e37af6 commit fc968e2

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

judge/testcase_run.sh

+15-3
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,21 @@ resourceinfo="\
311311
runtime: ${program_cputime}s cpu, ${program_walltime}s wall
312312
memory used: ${memory_bytes} bytes"
313313
if grep '^time-result: .*timelimit' program.meta >/dev/null 2>&1 ; then
314-
echo "Timelimit exceeded." >>system.out
315-
echo "$resourceinfo" >>system.out
316-
cleanexit ${E_TIMELIMIT:-1}
314+
if [ $COMBINED_RUN_COMPARE -eq 1 ] && grep '^exitcode: 43' compare.meta > /dev/null 2>&1 ; then
315+
# For interactive problems with combined run/compare scripts, a
316+
# WA may override TLE.
317+
# FIXME: For now, we only write to compare.meta if the
318+
# validator exited first, but we should always write the meta
319+
# file and include information about which exited first and
320+
# when.
321+
echo "Timelimit exceeded, but validator exited first with WA." >>system.out
322+
echo "$resourceinfo" >>system.out
323+
cleanexit ${E_WRONG_ANSWER:-1}
324+
else
325+
echo "Timelimit exceeded." >>system.out
326+
echo "$resourceinfo" >>system.out
327+
cleanexit ${E_TIMELIMIT:-1}
328+
fi
317329
fi
318330
if [ "$program_exit" != "0" ]; then
319331
echo "Non-zero exitcode $program_exit" >>system.out

0 commit comments

Comments
 (0)