Count the number of ways to obtain a sum, with consecutivity restriction
This looks wrong:

memset(arr, -1, sizeof(arr));


This is setting sizeof(int*) bytes of arr to -1.  It doesn't set the entire contents of arr.

You should probably be doing this:

int arr_size = sizeof(int)*score;
arr = (int*)malloc(arr_size);
memset(arr, -1, arr_size);


Although as pointed out by @Andrea Biondo, this only works because most architectures and compilers are based around twos complement numbers.  There are some exceptions to this rule, which you're likely to know about if they effect you.