Created
January 28, 2011 17:05
-
-
Save aeurielesn/800562 to your computer and use it in GitHub Desktop.
A simple script to judge problems using Bash
This file contains hidden or 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 | |
cnt=0 | |
ZERO=0 | |
for i in {1..10} | |
do | |
if [ -f $1.out ] | |
then | |
rm $1.out | |
fi | |
cp test-data/$1/$1.in.$i $1.in | |
time $2 | |
ans=`diff $1.out test-data/$1/$1.out.$i | wc -l` | |
if [ -f $1.out ] && [ "$ans" = "$ZERO" ]; then | |
echo "$i: OK" | |
cnt=$[$cnt+1] | |
else | |
echo "$i: WA" | |
fi | |
done | |
echo $cnt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment