Long Challlenge

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

int main()
{

#ifndef ONLINE_JUDGE
freopen(“input.txt”, “r”, stdin);
freopen(“output.txt”, “w”, stdout);
#endif

int T;
cin >> T;
while (T--)
{
	int n;
	cin >> n;
	int arr[n];
	for (int i = 0; i < n; i++)
	{
		cin >> arr[i];
	}
	int worst = INT_MIN;
	int best = INT_MAX;
	int temp = best;
	int cnt1 = 1; int cnt2 = 1;
	for (int i = 0; i < n - 1; i++)
	{
		if (arr[i + 1] - arr[i] <= 2)
		{
			cnt1++;
			worst = max(worst, cnt1);
		}
		if (arr[i + 1] - arr[i] > 2)
		{
			cnt1 = 1;
			worst = max(worst, cnt1);
		}
	}
	for (int i = 0; i < n - 1; i++)
	{
		if (arr[i + 1] - arr[i] <= 2)
		{

			cnt2++;


		}
		//best = min(best, cnt2);
		if (arr[i + 1] - arr[i] > 2)
		{
			best = min(best, cnt2);
			cnt2 = 1;

		}
	}
	best = min(best, cnt2);
	if (best == temp)
	{
		cout << n << " " << worst << endl;
	}
	else
		cout << best << " " << worst << endl;
}
return 0;

}

Question

when i am running the testcases its showing answer but when i am running it in codechef it is throwing me SGTSTP error.Where am i doing wrong?

it’s an ongoing contest, so let me ask whether i should discuss in this platform?

I am not asking algorithm here,while I was running this code in codechef I was getting sigtstp error
I wanted to know what it is and how to overcome it?
Though it was showing me the above error it got submitted correctly and why is that so?