bhupixb

tester on sample tc for CF

Apr 2nd, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. clear
  2. sol=$2
  3. # echo $sol
  4. g++ -std=c++17 $2 -o solD
  5. problem=$1
  6. cp solD tester/$problem
  7. cd tester/$problem
  8.  
  9.  
  10. RED='\033[0;31m'
  11. GREEN='\033[032m'
  12. NC='\033[0m' # No Color
  13. # n=`tput sgr0`
  14.  
  15. # printf "I ${RED}love${NC} Stack Overflow\n"
  16.  
  17.  
  18. infiles=(`ls in*.txt`)
  19. # echo ${infiles[@]}
  20. for ((i=0; i<${#infiles[@]}; i++)); do
  21. echo "Test Case: #$i"
  22. ./solD < in$i.txt > you.txt
  23. diff -w -y out$i.txt you.txt && printf "${GREEN}Accepted${NC}" || printf "${RED}Wrong Answer on Test $i${NC}"
  24. echo
  25. # diff out$i.txt you.txt>new && echo "#$i Accepted"
  26. # || echo "Your Output: " || cat you.txt || echo "Expected Output: "cat out$i.txt
  27.  
  28. # diff -w out$i.txt you.txt > new || f=1
  29. # cat $f
  30. # echo $st
  31. # then
  32. # cat out$i.txt
  33. # echo
  34. # cat yout$i.txt
  35. # # elif
  36. # # echo "#$i Accepted"
  37. # fi
  38. done
  39. echo
  40.  
  41. cd ..
  42. # ./diff.sh $problem
  43. cd ..
Add Comment
Please, Sign In to add comment