Remember the Future

Limits: 2s, 1.0 GB

You are an alien living in the future. You can move through one time dimension to another time dimension. This time travel is controlled by a Time Travel Company (TTC).


This is a companion discussion topic for the original entry at https://toph.co/p/remember-the-future

@hjr265 please check submission no 356456.
I think there is some malformed inputs or something like that in tests that causing me RE.

Not this time :slight_smile:

I have updated the input specification to clarify something which is possibly the cause of RE for you.

#include <stdio.h>

int main()
{
int t,n,ara[1001],i,temp,j,max,h=1;
scanf("%d",&t);
while(t–){
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&temp);
if(temp<0) ara[i]=temp*(-1);
else ara[i]=temp;
}
for(i=0,max=ara[0];i<n;i++){
for(j=i;j<n;j++){
if(ara[i]<ara[j]) break;
}
if(j==n){
max=ara[i];
break;
}
}
printf(“Case %d: %d\n”,h,max);
h++;

}
return 0;
}
//Cant seem to find whats wrong in my code
//WA in test case 2