对拍
plus.cpp 里已经有 freopen 了,不需要重定向。
#!/bin/bash
name="plus"
dir="JS-S10083/$name"
code="$dir/$name"
infile="$dir/$name.in"
outfile="$dir/$name.out"
touch "$infile"
touch "$outfile"
cnt=0
while ((cnt<123)); do
./data > "$infile"
./brute < "$infile" > brute.out
./"$code"
if diff -q "$outfile" brute.out; then
echo "AC"
else
echo "WA"
echo "in"
cat "$infile"
echo "yours"
cat "$outfile"
echo "std"
cat brute.out
exit 0
fi
done注:
- 如果
Permission denied,请用chmod +x dps.sh授权。 - 在使用
./时,请先用pwd/ls确认当前目录是否正确。 - 运行脚本:
Bash pwd #确认 ls #确认 ./dps.sh