Following solution for problem Football is failing with SIGTSTP error
susi_45:
#include < cstdio >
using namespace std;
long long a[10001], b[10001], score[10001];
int main() {
long long n,tc,i,j,max;
scanf(“%lld”,&tc);
while(tc–){
scanf(“%lld”,&n);
for(i=0;i<n;i++) scanf(“%lld”,&a[i]);
for(i=0;i<n;i++) scanf(“%lld”,&b[i]);
for(i=0;i<n;i++){
score[i] = (20 * a[i]) - (10 * b[i]);
}
max = -9999999999;
for(i=0;i<n;i++) if(score[i] > max) max = score[i];
if(max < 0) max = 0;
printf(“%lld\n”,max);
}
return 0;
}
I am using C++ 14 (GCC 6.3)
Share the link of your submission
Strange!! When I was running it in codechef ide it was giving this RT error, but my submission got Accepted. Any idea why?
ssjgz
August 13, 2019, 11:55am
4
Did you provide custom input?
1 Like
No. I didn’t. Same code was running fine in ideone.
Provide Custom input and also check whether #include and while statements are written in correct order.
I mean to say don’t write while(t–) as while(t-)
also don’t write as #include < cstdio > (with spaces)