SIGTSTP ERROR

I have tried my best to remove this error .but the program is not working .
i have attached the problem below
click here

My CODE LINK IS
click here
plz give me the reason why it is showing error and also corrected code (or even its link)

@psg2000 why did you limit the size of array to 10… but problem statement says 2 ≤ N ≤ 200,000…

HELP ME FAST

Since ZCO Practice Contest is an ongoing contest for practice, the submissions are not visible. Paste your code in pastebin.com or ideone.com and then share its link.

1 Like

#include
#include<math.h>

using namespace std;
 
int main()  {  int n; long a[10],i;long profit=0;long diff;int j;
                   cin>>n;
                   for(i=0;i<n;i++)
                   {cin>>a[i];}
                 for(i=0;i<n;i++)
                   {for(j=i+1;j<n;j++)
                       {diff=abs(a[i]-a[j]);
                           profit+=diff;
                       }
                   }
                   cout<<profit<<endl;
                  
 
 
	return 0;
}

FAST PLZ…THNKS C_UTKARSH …

1 Like

NOT WORKING???