Maximum Subarray Sum - Error

#include
#include
using namespace std;

int main() {
int t;
cin>>t;

int n;
long int arr[10000];


for(int i=0;i<t;++i){
	cin>>n;
    int csum=0,maxsum=0;
	if(n<1||n>100000)
    return 0;

	for(int j=0;j<n;++j)
	cin>>arr[j];

    for(int k=0;k<n;++k)
	{
		csum+=arr[k];
		if(csum<0)
		csum=0;

		maxsum=max(csum,maxsum);
	}

	cout<<maxsum<<"\n";
}
return 0;

}

PROBLEM: The code is working fine on my machine and during compiling and testing. But when I submit, I am getting a ‘run error’ in all the test cases.

@poojagera value of ‘n’ can be upto 100000 so define
long int arr[100001] and maxsum and csum also as ‘long long int’

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us 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.