the link to the problem is here : https://www.codechef.com/problems/CARVANS
The following is my code and I am unable to find what is causing the SIGTSTP error -
#include<bits/stdc++.h>
#include<iostream>
using namespace std;
int main()
{
int t;
//cout<<"\nEnter the number of testcases:";
scanf("%d", &t);
while(t)
{
int n;
//cout<<"\nEnter the number of cars";
scanf("%d", &n);
int s[n];
for(int i=0;i<n;i++)
{
//cout<<"\nEnter the speed ";
scanf("%d", &s[i]);
}
int count = 0;
if(n>1)
{
for(int l=0;(l+1)<n;l++)
{
if(l==0)
count++;
if(s[l] > s[l+1])
count++;
else
;
}
}
else
{
count++;
}
printf("%d",count);
t--;
}
return 0;
}