Hello,
        I am a newbie in the programming contest. I was looking through the
xdliutao(rank 4) code and i found that it gives the same output as my code.
The output does contain some negative values which result in cancellation of
my code. Do you guys suggest me....that is there a problem exists in my code
or my machine?

and this is not the first time for me that my code outputs garbage value.:)

-- 
Thanks & Regards,

Amitesh Purwar.

Twitter : http://bit.ly/jQfDo
facebook : http://bit.ly/xIlCn

Contact No. :- +91-9718418621

-- 
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.

#include<stdio.h>
#include<conio.h>
#include<process.h>
#include<fstream.h>
int main()
{
FILE *ifp, *ofp;
int arr[10000],brr[10000],i,j,n,k,t;
long int c=0;
 char outputfilename[]="asmall2.out";
  ifp=fopen("A6.in","r");

  if(ifp== NULL)
  {fprintf(stderr,"cant open the input file %s\n",ifp);
   exit(1);
  }

  ofp=fopen(outputfilename, "w");

  if(ofp == NULL)
  {
   fprintf(stderr,"cant open the output file %s\n", outputfilename);
   exit(1);
  }
  fscanf(ifp,"%d",&t);


for(k=0;k<t;k++)
{
fscanf(ifp,"%d",&n);
for(i=0;i<n;i++)
{
fscanf(ifp,"%d%d",&arr[i],&brr[i]);
}
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
if((arr[i]<arr[j]) && (brr[i]>brr[j]))
{

 c++;
}
}
}
fprintf(ofp,"Case #%d: %d\n",k+1,c);
c=0;
}
printf("Enter");
getch();
return 0;
}

Reply via email to