F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_20613016_17396.cpp:4:26: error: stray '#' in program
     using namespace std; #define min(a,b) a < b ? a : b struct TT{    int x,y;    bool operator <(const TT& s)const    {        return x < s.x;    }}A[1002]; bool One_Line(const TT& s1,const TT& s2,const TT& s3){    return (s2.y-s1.y)*(s3.x-s2.x) == (s3.y-s2.y)*(s2.x-s1.x);} double dis(const TT& s1,const TT& s2){    return sqrt( (double)(s1.x-s2.x)*(s1.x-s2.x) + (s1.y-s2.y)*(s1.y-s2.y) );} int main(){    int z,n,ncase=0;    scanf("%d",&z);    while(z--)    {        scanf("%d",&n);        for(int i=0;i<n;i++)            scanf("%d%d",&A[i].x,&A[i].y);        sort(A,A+n);        double ans = 1e7;        for(int i=0;i<n-2;i++)        {            for(int j=i+1;j<n-1;j++)            {                if(ans <= 2*(A[j].x-A[i].x))                    break;                double a = dis(A[i],A[j]);                if(ans <= 2*a)                    continue;                for(int k=j+1;k<n;k++)                {                    if(ans <= 2*(A[k].x-A[i].x))                        break;                    if(One_Line(A[i],A[j],A[k]))                        continue;                    double b = dis(A[j],A[k]);                    double c = dis(A[k],A[i]);                    ans = min(ans,a+b+c);                }            }        }        printf("Case %d: ",++ncase);        if(ans == 1e7)            puts("No Solution");        else            printf("%.3f\n",ans);    }    return 0;}
                          ^
0_0_20613016_17396.cpp:4:27: error: 'define' does not name a type
     using namespace std; #define min(a,b) a < b ? a : b struct TT{    int x,y;    bool operator <(const TT& s)const    {        return x < s.x;    }}A[1002]; bool One_Line(const TT& s1,const TT& s2,const TT& s3){    return (s2.y-s1.y)*(s3.x-s2.x) == (s3.y-s2.y)*(s2.x-s1.x);} double dis(const TT& s1,const TT& s2){    return sqrt( (double)(s1.x-s2.x)*(s1.x-s2.x) + (s1.y-s2.y)*(s1.y-s2.y) );} int main(){    int z,n,ncase=0;    scanf("%d",&z);    while(z--)    {        scanf("%d",&n);        for(int i=0;i<n;i++)            scanf("%d%d",&A[i].x,&A[i].y);        sort(A,A+n);        double ans = 1e7;        for(int i=0;i<n-2;i++)        {            for(int j=i+1;j<n-1;j++)            {                if(ans <= 2*(A[j].x-A[i].x))                    break;                double a = dis(A[i],A[j]);                if(ans <= 2*a)                    continue;                for(int k=j+1;k<n;k++)                {                    if(ans <= 2*(A[k].x-A[i].x))                        break;                    if(One_Line(A[i],A[j],A[k]))                        continue;                    double b = dis(A[j],A[k]);                    double c = dis(A[k],A[i]);                    ans = min(ans,a+b+c);                }            }        }        printf("Case %d: ",++ncase);        if(ans == 1e7)            puts("No Solution");        else            printf("%.3f\n",ans);    }    return 0;}
                           ^
0_0_20613016_17396.cpp:4:150: error: 'A' does not name a type
     using namespace std; #define min(a,b) a < b ? a : b struct TT{    int x,y;    bool operator <(const TT& s)const    {        return x < s.x;    }}A[1002]; bool One_Line(const TT& s1,const TT& s2,const TT& s3){    return (s2.y-s1.y)*(s3.x-s2.x) == (s3.y-s2.y)*(s2.x-s1.x);} double dis(const TT& s1,const TT& s2){    return sqrt( (double)(s1.x-s2.x)*(s1.x-s2.x) + (s1.y-s2.y)*(s1.y-s2.y) );} int main(){    int z,n,ncase=0;    scanf("%d",&z);    while(z--)    {        scanf("%d",&n);        for(int i=0;i<n;i++)            scanf("%d%d",&A[i].x,&A[i].y);        sort(A,A+n);        double ans = 1e7;        for(int i=0;i<n-2;i++)        {            for(int j=i+1;j<n-1;j++)            {                if(ans <= 2*(A[j].x-A[i].x))                    break;                double a = dis(A[i],A[j]);                if(ans <= 2*a)                    continue;                for(int k=j+1;k<n;k++)                {                    if(ans <= 2*(A[k].x-A[i].x))                        break;                    if(One_Line(A[i],A[j],A[k]))                        continue;                    double b = dis(A[j],A[k]);                    double c = dis(A[k],A[i]);                    ans = min(ans,a+b+c);                }            }        }        printf("Case %d: ",++ncase);        if(ans == 1e7)            puts("No Solution");        else            printf("%.3f\n",ans);    }    return 0;}
                                                                                                                                                      ^
0_0_20613016_17396.cpp:4:179: error: 'TT' does not name a type
     using namespace std; #define min(a,b) a < b ? a : b struct TT{    int x,y;    bool operator <(const TT& s)const    {        return x < s.x;    }}A[1002]; bool One_Line(const TT& s1,const TT& s2,const TT& s3){    return (s2.y-s1.y)*(s3.x-s2.x) == (s3.y-s2.y)*(s2.x-s1.x);} double dis(const TT& s1,const TT& s2){    return sqrt( (double)(s1.x-s2.x)*(s1.x-s2.x) + (s1.y-s2.y)*(s1.y-s2.y) );} int main(){    int z,n,ncase=0;    scanf("%d",&z);    while(z--)    {        scanf("%d",&n);        for(int i=0;i<n;i++)            scanf("%d%d",&A[i].x,&A[i].y);        sort(A,A+n);        double ans = 1e7;        for(int i=0;i<n-2;i++)        {            for(int j=i+1;j<n-1;j++)            {                if(ans <= 2*(A[j].x-A[i].x))                    break;                double a = dis(A[i],A[j]);                if(ans <= 2*a)                    continue;                for(int k=j+1;k<n;k++)                {                    if(ans <= 2*(A[k].x-A[i].x))                        break;                    if(One_Line(A[i],A[j],A[k]))                        continue;                    double b = dis(A[j],A[k]);                    double c = dis(A[k],A[i]);                    ans = min(ans,a+b+c);                }            }        }        printf("Case %d: ",++ncase);        if(ans == 1e7)            puts("No Solution");        else            printf("%.3f\n",ans);    }    return 0;}
                                                                                                                                                                                   ^
0_0_20613016_17396.cpp:4:192: error: 'TT' does not name a type
     using namespace std; #define min(a,b) a < b ? a : b struct TT{    int x,y;    bool operator <(const TT& s)const    {        return x < s.x;    }}A[1002]; bool One_Line(const TT& s1,const TT& s2,const TT& s3){    return (s2.y-s1.y)*(s3.x-s2.x) == (s3.y-s2.y)*(s2.x-s1.x);} double dis(const TT& s1,const TT& s2){    return sqrt( (double)(s1.x-s2.x)*(s1.x-s2.x) + (s1.y-s2.y)*(s1.y-s2.y) );} int main(){    int z,n,ncase=0;    scanf("%d",&z);    while(z--)    {        scanf("%d",&n);        for(int i=0;i<n;i++)            scanf("%d%d",&A[i].x,&A[i].y);        sort(A,A+n);        double ans = 1e7;        for(int i=0;i<n-2;i++)        {            for(int j=i+1;j<n-1;j++)            {                if(ans <= 2*(A[j].x-A[i].x))                    break;                double a = dis(A[i],A[j]);                if(ans <= 2*a)                    continue;                for(int k=j+1;k<n;k++)                {                    if(ans <= 2*(A[k].x-A[i].x))                        break;                    if(One_Line(A[i],A[j],A[k]))                        continue;                    double b = dis(A[j],A[k]);                    double c = dis(A[k],A[i]);                    ans = min(ans,a+b+c);                }            }        }        printf("Case %d: ",++ncase);        if(ans == 1e7)            puts("No Solution");        else            printf("%.3f\n",ans);    }    return 0;}
                                                                                                                                                                                                ^
0_0_20613016_17396.cpp:4:205: error: 'TT' does not name a type
     using namespace std; #define min(a,b) a < b ? a : b struct TT{    int x,y;    bool operator <(const TT& s)const    {        return x < s.x;    }}A[1002]; bool One_Line(const TT& s1,const TT& s2,const TT& s3){    return (s2.y-s1.y)*(s3.x-s2.x) == (s3.y-s2.y)*(s2.x-s1.x);} double dis(const TT& s1,const TT& s2){    return sqrt( (double)(s1.x-s2.x)*(s1.x-s2.x) + (s1.y-s2.y)*(s1.y-s2.y) );} int main(){    int z,n,ncase=0;    scanf("%d",&z);    while(z--)    {        scanf("%d",&n);        for(int i=0;i<n;i++)            scanf("%d%d",&A[i].x,&A[i].y);        sort(A,A+n);        double ans = 1e7;        for(int i=0;i<n-2;i++)        {            for(int j=i+1;j<n-1;j++)            {                if(ans <= 2*(A[j].x-A[i].x))                    break;                double a = dis(A[i],A[j]);                if(ans <= 2*a)                    continue;                for(int k=j+1;k<n;k++)                {                    if(ans <= 2*(A[k].x-A[i].x))                        break;                    if(One_Line(A[i],A[j],A[k]))                        continue;                    double b = dis(A[j],A[k]);                    double c = dis(A[k],A[i]);                    ans = min(ans,a+b+c);                }            }        }        printf("Case %d: ",++ncase);        if(ans == 1e7)            puts("No Solution");        else            printf("%.3f\n",ans);    }    return 0;}
                                                                                                                                                                                                             ^
0_0_20613016_17396.cpp: In function 'bool One_Line(const int&, const int&, const int&)':
0_0_20613016_17396.cpp:4:228: error: request for member 'y' in 's2', which is of non-class type 'const int'
     using namespace std; #define min(a,b) a < b ? a : b struct TT{    int x,y;    bool operator <(const TT& s)const    {        return x < s.x;    }}A[1002]; bool One_Line(const TT& s1,const TT& s2,const TT& s3){    return (s2.y-s1.y)*(s3.x-s2.x) == (s3.y-s2.y)*(s2.x-s1.x);} double dis(const TT& s1,const TT& s2){    return sqrt( (double)(s1.x-s2.x)*(s1.x-s2.x) + (s1.y-s2.y)*(s1.y-s2.y


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-16 09:32:35, Gzip enabled