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_20613302_15878.cpp:2:25: error: stray '#' in program
     using namespace std;#define N 40005struct node{    double x,y;}p[N];int n;double cal_dis(int x,int y){    double x1=p[x].x,y1=p[x].y;    double x2=p[y].x,y2=p[y].y;    return (x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);}int main(void){    while(~scanf("%d",&n)){        int k=1;        for(int i=1;i<=n;i++){            scanf("%lf%lf",&p[k].x,&p[k].y);            if(k!=1&&k%2){                p[k-1].x=(p[k-2].x+p[k].x)/2.0;                p[k-1].y=(p[k-2].y+p[k].y)/2.0;            }            k+=2;        }        p[k-1].x=(p[1].x+p[k-2].x)/2.0;        p[k-1].y=(p[1].y+p[k-2].y)/2.0;        bool flag=0;        for(int i=1;i<=n;i++){            double x1=p[i].x-p[i+n].x;            double y1=p[i].y-p[i+n].y;            int j,k;            k=i-1;            j=i+1;            for(;j<=i+n;j++,k--){                if(k<=0) k=2*n;                double x2=p[j].x-p[k].x;                double y2=p[j].y-p[k].y;                if(x1*x2+y1*y2!=0)                    break;                if(cal_dis(i,j)!=cal_dis(i,k))                    break;            }            if(j>i+n){                flag=1;                break;            }        }        if(flag)            printf("YES\n");        else            printf("NO\n");    }}
                         ^
0_0_20613302_15878.cpp:2:26: error: 'define' does not name a type
     using namespace std;#define N 40005struct node{    double x,y;}p[N];int n;double cal_dis(int x,int y){    double x1=p[x].x,y1=p[x].y;    double x2=p[y].x,y2=p[y].y;    return (x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);}int main(void){    while(~scanf("%d",&n)){        int k=1;        for(int i=1;i<=n;i++){            scanf("%lf%lf",&p[k].x,&p[k].y);            if(k!=1&&k%2){                p[k-1].x=(p[k-2].x+p[k].x)/2.0;                p[k-1].y=(p[k-2].y+p[k].y)/2.0;            }            k+=2;        }        p[k-1].x=(p[1].x+p[k-2].x)/2.0;        p[k-1].y=(p[1].y+p[k-2].y)/2.0;        bool flag=0;        for(int i=1;i<=n;i++){            double x1=p[i].x-p[i+n].x;            double y1=p[i].y-p[i+n].y;            int j,k;            k=i-1;            j=i+1;            for(;j<=i+n;j++,k--){                if(k<=0) k=2*n;                double x2=p[j].x-p[k].x;                double y2=p[j].y-p[k].y;                if(x1*x2+y1*y2!=0)                    break;                if(cal_dis(i,j)!=cal_dis(i,k))                    break;            }            if(j>i+n){                flag=1;                break;            }        }        if(flag)            printf("YES\n");        else            printf("NO\n");    }}
                          ^
0_0_20613302_15878.cpp:2:68: error: 'p' does not name a type
     using namespace std;#define N 40005struct node{    double x,y;}p[N];int n;double cal_dis(int x,int y){    double x1=p[x].x,y1=p[x].y;    double x2=p[y].x,y2=p[y].y;    return (x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);}int main(void){    while(~scanf("%d",&n)){        int k=1;        for(int i=1;i<=n;i++){            scanf("%lf%lf",&p[k].x,&p[k].y);            if(k!=1&&k%2){                p[k-1].x=(p[k-2].x+p[k].x)/2.0;                p[k-1].y=(p[k-2].y+p[k].y)/2.0;            }            k+=2;        }        p[k-1].x=(p[1].x+p[k-2].x)/2.0;        p[k-1].y=(p[1].y+p[k-2].y)/2.0;        bool flag=0;        for(int i=1;i<=n;i++){            double x1=p[i].x-p[i+n].x;            double y1=p[i].y-p[i+n].y;            int j,k;            k=i-1;            j=i+1;            for(;j<=i+n;j++,k--){                if(k<=0) k=2*n;                double x2=p[j].x-p[k].x;                double y2=p[j].y-p[k].y;                if(x1*x2+y1*y2!=0)                    break;                if(cal_dis(i,j)!=cal_dis(i,k))                    break;            }            if(j>i+n){                flag=1;                break;            }        }        if(flag)            printf("YES\n");        else            printf("NO\n");    }}
                                                                    ^
0_0_20613302_15878.cpp: In function 'double cal_dis(int, int)':
0_0_20613302_15878.cpp:2:121: error: 'p' was not declared in this scope
     using namespace std;#define N 40005struct node{    double x,y;}p[N];int n;double cal_dis(int x,int y){    double x1=p[x].x,y1=p[x].y;    double x2=p[y].x,y2=p[y].y;    return (x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);}int main(void){    while(~scanf("%d",&n)){        int k=1;        for(int i=1;i<=n;i++){            scanf("%lf%lf",&p[k].x,&p[k].y);            if(k!=1&&k%2){                p[k-1].x=(p[k-2].x+p[k].x)/2.0;                p[k-1].y=(p[k-2].y+p[k].y)/2.0;            }            k+=2;        }        p[k-1].x=(p[1].x+p[k-2].x)/2.0;        p[k-1].y=(p[1].y+p[k-2].y)/2.0;        bool flag=0;        for(int i=1;i<=n;i++){            double x1=p[i].x-p[i+n].x;            double y1=p[i].y-p[i+n].y;            int j,k;            k=i-1;            j=i+1;            for(;j<=i+n;j++,k--){                if(k<=0) k=2*n;                double x2=p[j].x-p[k].x;                double y2=p[j].y-p[k].y;                if(x1*x2+y1*y2!=0)                    break;                if(cal_dis(i,j)!=cal_dis(i,k))                    break;            }            if(j>i+n){                flag=1;                break;            }        }        if(flag)            printf("YES\n");        else            printf("NO\n");    }}
                                                                                                                         ^
0_0_20613302_15878.cpp:2:197: error: 'y1' was not declared in this scope
     using namespace std;#define N 40005struct node{    double x,y;}p[N];int n;double cal_dis(int x,int y){    double x1=p[x].x,y1=p[x].y;    double x2=p[y].x,y2=p[y].y;    return (x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);}int main(void){    while(~scanf("%d",&n)){        int k=1;        for(int i=1;i<=n;i++){            scanf("%lf%lf",&p[k].x,&p[k].y);            if(k!=1&&k%2){                p[k-1].x=(p[k-2].x+p[k].x)/2.0;                p[k-1].y=(p[k-2].y+p[k].y)/2.0;            }            k+=2;        }        p[k-1].x=(p[1].x+p[k-2].x)/2.0;        p[k-1].y=(p[1].y+p[k-2].y)/2.0;        bool flag=0;        for(int i=1;i<=n;i++){            double x1=p[i].x-p[i+n].x;            double y1=p[i].y-p[i+n].y;            int j,k;            k=i-1;            j=i+1;            for(;j<=i+n;j++,k--){                if(k<=0) k=2*n;                double x2=p[j].x-p[k].x;                double y2=p[j].y-p[k].y;                if(x1*x2+y1*y2!=0)                    break;                if(cal_dis(i,j)!=cal_dis(i,k))                    break;            }            if(j>i+n){                flag=1;                break;            }        }        if(flag)            printf("YES\n");        else            printf("NO\n");    }}
                                                                                                                                                                                                     ^
0_0_20613302_15878.cpp:2:200: error: 'y2' was not declared in this scope
     using namespace std;#define N 40005struct node{    double x,y;}p[N];int n;double cal_dis(int x,int y){    double x1=p[x].x,y1=p[x].y;    double x2=p[y].x,y2=p[y].y;    return (x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);}int main(void){    while(~scanf("%d",&n)){        int k=1;        for(int i=1;i<=n;i++){            scanf("%lf%lf",&p[k].x,&p[k].y);            if(k!=1&&k%2){                p[k-1].x=(p[k-2].x+p[k].x)/2.0;                p[k-1].y=(p[k-2].y+p[k].y)/2.0;            }            k+=2;        }        p[k-1].x=(p[1].x+p[k-2].x)/2.0;        p[k-1].y=(p[1].y+p[k-2].y)/2.0;        bool flag=0;        for(int i=1;i<=n;i++){            double x1=p[i].x-p[i+n].x;            double y1=p[i].y-p[i+n].y;            int j,k;            k=i-1;            j=i+1;            for(;j<=i+n;j++,k--){                if(k<=0) k=2*n;                double x2=p[j].x-p[k].x;                double y2=p[j].y-p[k].y;                if(x1*x2+y1*y2!=0)                    break;                if(cal_dis(i,j)!=cal_dis(i,k))                    break;            }            if(j>i+n){                flag=1;                break;            }        }        if(flag)            printf("YES\n");        else            printf("NO\n");    }}
                                                                                                                                                                                                        ^
0_0_20613302_15878.cpp: In function 'int main()':
0_0_20613302_15878.cpp:2:329: error: 'p' was not declared in this scope
     using namespace std;#define N 40005struct node{    double x,y;}p[N];int n;double cal_dis(int x,int y){    double x1=p[x].x,y1=p[x].y;    double x2=p[y].x,y2=p[y].y;    return (x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);}int main(void){    while(~scanf("%d",&n)){        int k=1;        for(int i=1;i<=n;i++){            scanf("%lf%lf",&p[k].x,&p[k].y);            if(k!=1&&k%2){                p[k-1].x=(p[k-2].x+p[k].x)/2.0;                p[k-1].y=(p[k-2].y+p[k].y)/2.0;            }            k+=2;        }        p[k-1].x=(p[1].x+p[k-2].x)/2.0;        p[k-1].y=(p[1].y+p[k-2].y)/2.0;        bool flag=0;        for(int i=1;i<=n;i++){            double x1=p[i].x-p[i+n].x;            double y1=p[i].y-p[i+n].y;            int j,k;            k=i-1;            j=i+1;            for(;j<=i+n;j++,k--){                if(k<=0) k=2*n;                double x2=p[j].x-p[k].x;                double y2=p[j].y-p[k].y;                if(x1*x2+y1*y2!=0)                    break;                if(cal_dis(i,j)!=cal_dis(i,k))                    break;            }            if(j>i+n){                flag=1;                break;            }        }        if(flag)            printf("YES\n");        else            printf("NO\n");    }}
                                                                                                                                                                                                                                                                                             


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-26 17:11:00, Gzip enabled