SIGTSTP ERROR in "Moving Rectangles" (RECTARAN)

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;
}

Please either format your code or (better!) link to your submission - the forum software has mangled it and it won’t compile! :slight_smile:

I have a question - Do you type that line every single time or do you copy-paste it?

1 Like

Copy and paste :slight_smile:

2 Likes