diff options
Diffstat (limited to '01-knapsack/run')
-rwxr-xr-x | 01-knapsack/run | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/01-knapsack/run b/01-knapsack/run new file mode 100755 index 0000000..df6db5e --- /dev/null +++ b/01-knapsack/run @@ -0,0 +1,18 @@ +#! /bin/bash + +RESET="\033[0m" +RED="\033[0;31m" + +BIN=${BIN:-ks_dp-ng} +${CC:-clang} -O2 -pedantic -Wall -o $BIN $BIN.c || exit 1 + +DATAS=(ks_4_0 ks_19_0 ks_30_0 ks_40_0 ks_45_0 ks_50_0 ks_50_1 ks_60_0 ks_100_0 ks_100_1 ks_100_2 ks_200_0 ks_200_1 ks_300_0 ks_400_0 ks_500_0 ks_1000_0 ks_10000_0) +VALUES=(19 12248 99798 99924 23974 142156 5345 99837 99837 1333930 10892 100236 1103604 1688692 3967180 54939 109899 1099893) + +for((i=0;i<${#DATAS[@]};i++)) +do + data="./data/${DATAS[$i]}" + value="${VALUES[$i]}" + echo -e "$RED *** $data -e $value $@ $RESET" + ./$BIN $data -e $value $@ +done |