While solving a problem, I am getting an error of SIGTSTP (also showing time limit exceeded).It’s perfectly working with the given sample case as well as my custom set of inputs.
question code is:RECTARAN
#include
int main()
{
int test;//how many test are to perform
std::cin>>test;
while(test–)
{
int n;
std::cin>>n;
int temp=n;
int v1,v2,d1,d2,dir;
while(temp--)
{
std::cin>>v1>>v2>>d1>>d2>>dir;
}
while(n--)
{
std::string s;
std::cin>>s;
int x=3;
static int t=0;
if(s[1]=='E')
{
t=t+1;
dir=(dir+2)%4;
std::cout<<x<<" "<<t<<"\n";
}
else{
t=t+1;
dir=(dir+1)%4;
std::cout<<x<<" "<<dir<<" "<<t<<"\n";
}
}
}
return 0;
}