Shows run-error on submitting code

what am i doing wrong?

@samikshamodi7 Hey Samiksha,
Hint : The value of N ranges from 1 <= N <= 100000.

@samikshamodi7 I hope I’ve cleared your doubt. Please mark this doubt as resolved and rate me on the basis of your experience. Rating option is just below where you mark this doubt as resolve. Your feedback is very important. It helps us to improve our platform and hence provide you the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen the doubt.

even on converting it to long long int, it shows run-error

@samikshamodi7 Hey Samiksha, N means size of array
Syntax of Array : Data_Type ArrayName[Size Of Array];
so now a[100] wiil be a[100000] and also ms[100000]

and you did int to long long int means how big value one block(variable) of array(a[0] or a[1] or a[2]) can store.
the range of that is also given -100000000 <= A[i] <= 100000000 so here int data type is sufficient for arrar a[100000]

but for cs variable and ms array we have to take data type long long int
because let’s consider worst case scenario when N = 100000 and value of a[i] is given 100000000 for all i ranges from 0 to 99999. so cs become(N*valueOfOneBlock) cs = 10000000000000 which can’t fit in int datatype after iteration.

@samikshamodi7 Hey Samiskha, You are using kaden’s algorithm for this. But code which shown in the video can’t work for negative element so you have to modify little bit in that code.

Refer below code. In this code i only interchange the position of if block of code which shown in the video and also initialized the maximumSum=LLONG_MIN.

Dry run this code and If you are not understanding this code than surely i will help.

code Link : https://ide.codingblocks.com/s/78212