Created
April 2, 2019 09:10
-
-
Save albertoxamin/37a37675859aecbb69b2f1dec518204c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Judge script | |
# For personal use only, not to be used on a real judge system | |
# Execution: put the executable in the same folder with the inputs as .in files and expected outputs as .ans | |
for input in *.in; do | |
for ((i=0; i<=3; i++)); do | |
./a.out < "$input" > "temp" | |
filename=$(basename ${input%.*}.ans) | |
result=$(diff -w "$filename" "temp") | |
if [ $? -eq 0 ] | |
then | |
echo "OK" | |
else | |
echo "diff" $result $filename | |
fi | |
rm "temp" | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment