ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1207. Median on the Plane

PLease..will someone tell me how to understand why CompError?Here is my source
Posted by Vladimir Milenov Vasilev 14 Apr 2002 06:01
Here is my source.I am using VStudio 6.0 an dit is OK but...I got
Compilation Error. How to understand why and what to compile my
program with????

#include <stdio.h>
long ind,pom,n,x[10000],y[10000],ymin,i,j,xx,yy;
int pos[10000];
void main()
{
    scanf("%ld",&n);
    ymin=1000000000;
    for (i=0;i<n;i++)
    {
        scanf("%ld%ld",&x[i],&y[i]);
        pos[i]=i;
        if (ymin>y[i])
        {
            ind=i;
            ymin=y[i];
        }
    }
    pom=y[ind];
    y[ind]=y[n-1];
    y[n-1]=pom;
    pom=x[ind];
    x[ind]=x[n-1];
    x[n-1]=pom;
    xx=x[n-1];
    yy=y[n-1];
    pos[ind]=n-1;
    pos[n-1]=ind;
    for(i=0;i<n-1;i++)
        for(j=i+1;j<n;j++)
            if (((float)(x[i]-xx)*(float)(y[j]-yy))-
                ((float)(x[j]-xx)*(float)(y[i]-yy))>0)
            {
                pom=y[i];
                y[i]=y[j];
                y[j]=pom;
                pom=x[i];
                x[i]=x[j];
                x[j]=pom;
                pom=(long)pos[i];
                pos[i]=pos[j];
                pos[j]=(int)pom;
            }
printf("%d %d\n",pos[n-1]+1,pos[(int)((n/2)-1)]+1);
}
AFAIK *ALL* solutions on C/C++ get CE now.
Posted by Ivan Kazmenko (SPB SU FF) 14 Apr 2002 21:14
This is most probably an internal Timus problem. I sent 5 different
tasks and received the same reply yesterday - something like
"temp\184951(29) : error C2471: cannot update program database
'e:\judge\vc60.pdb'". So, we should write on Pascal or wait...