Can Anyone please help me why this code of me is showing SIGTSTP error
The code is this:-
#include <iostream>
using namespace std;
int main()
{
int t; int c=0;
cin>>t;
for(int i=1;i<=t;i++)
{
int n;
cin>>n;
int a[n]={};
for(int j=0;j<n;j++)
{
cin>>a[j];
}
for(int k=0;k<n;k++)
{
int b=5;int p=1;
if(k>4)
{
while(b>0)
{
if(a[k]>a[k-b])
{
p*=0;
}
b--;
}
}
else
{
int l=0;
while(l<k)
{
if(a[k]>a[l])
{
p*=0;
}
l++;
}
}
if(p==1)
{
c++;
}
}
cout<<(c)<<"\n";
}
return 0;
}
https://www.codechef.com/problems/S10E
This is the question.