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_20613444_18186.cpp:3:26: error: stray '#' in program
     using namespace std; #define max(a,b) ((a)>=(b)?(a):(b)) const int maxn = 50000; struct node{    double x, y;}pt[maxn+5]; bool set(double &tl, double &tr, double cl, double cr){    if (cl>tr || tl>cr) return false;    if (tr>cr) tr = cr;    if (tl<cl) tl = cl;    return true;} bool ok(double r, int n, double &p){    int i;    double r2 = r*r;    double td, tl, tr;    td = sqrt(r2-pt[0].y*pt[0].y);    tl = pt[0].x - td;    tr = pt[0].x + td;    for (i=1; i<n; i++)    {        td = sqrt(r2-pt[i].y*pt[i].y);        if (!set(tl, tr, pt[i].x-td, pt[i].x+td))            return false;    }    p = (tl+tr)/2;    return true;} void solve(int n, double &p, double &d){    double low = 0, high = 3e5;    int i;    for (i=0; i<n; i++) low = max(low, fabs(pt[i].y));    double mid;    while(fabs(high-low)>1e-9)    {        mid = (low+high)/2;        if (ok(mid, n, p))        {            d = mid;            high = mid;        }        else low = mid;    }} int main(){    int n;    int i;    double p, d;    while(scanf("%d", &n)!=EOF)    {        if (n==0) break;        for (i=0; i<n; i++) scanf("%lf %lf", &pt[i].x, &pt[i].y);        solve(n, p, d);        printf("%.9lf %.9lf\n", p, d);    }    return 0;}
                          ^
0_0_20613444_18186.cpp:3:27: error: 'define' does not name a type
     using namespace std; #define max(a,b) ((a)>=(b)?(a):(b)) const int maxn = 50000; struct node{    double x, y;}pt[maxn+5]; bool set(double &tl, double &tr, double cl, double cr){    if (cl>tr || tl>cr) return false;    if (tr>cr) tr = cr;    if (tl<cl) tl = cl;    return true;} bool ok(double r, int n, double &p){    int i;    double r2 = r*r;    double td, tl, tr;    td = sqrt(r2-pt[0].y*pt[0].y);    tl = pt[0].x - td;    tr = pt[0].x + td;    for (i=1; i<n; i++)    {        td = sqrt(r2-pt[i].y*pt[i].y);        if (!set(tl, tr, pt[i].x-td, pt[i].x+td))            return false;    }    p = (tl+tr)/2;    return true;} void solve(int n, double &p, double &d){    double low = 0, high = 3e5;    int i;    for (i=0; i<n; i++) low = max(low, fabs(pt[i].y));    double mid;    while(fabs(high-low)>1e-9)    {        mid = (low+high)/2;        if (ok(mid, n, p))        {            d = mid;            high = mid;        }        else low = mid;    }} int main(){    int n;    int i;    double p, d;    while(scanf("%d", &n)!=EOF)    {        if (n==0) break;        for (i=0; i<n; i++) scanf("%lf %lf", &pt[i].x, &pt[i].y);        solve(n, p, d);        printf("%.9lf %.9lf\n", p, d);    }    return 0;}
                           ^
0_0_20613444_18186.cpp:3:118: error: 'maxn' was not declared in this scope
     using namespace std; #define max(a,b) ((a)>=(b)?(a):(b)) const int maxn = 50000; struct node{    double x, y;}pt[maxn+5]; bool set(double &tl, double &tr, double cl, double cr){    if (cl>tr || tl>cr) return false;    if (tr>cr) tr = cr;    if (tl<cl) tl = cl;    return true;} bool ok(double r, int n, double &p){    int i;    double r2 = r*r;    double td, tl, tr;    td = sqrt(r2-pt[0].y*pt[0].y);    tl = pt[0].x - td;    tr = pt[0].x + td;    for (i=1; i<n; i++)    {        td = sqrt(r2-pt[i].y*pt[i].y);        if (!set(tl, tr, pt[i].x-td, pt[i].x+td))            return false;    }    p = (tl+tr)/2;    return true;} void solve(int n, double &p, double &d){    double low = 0, high = 3e5;    int i;    for (i=0; i<n; i++) low = max(low, fabs(pt[i].y));    double mid;    while(fabs(high-low)>1e-9)    {        mid = (low+high)/2;        if (ok(mid, n, p))        {            d = mid;            high = mid;        }        else low = mid;    }} int main(){    int n;    int i;    double p, d;    while(scanf("%d", &n)!=EOF)    {        if (n==0) break;        for (i=0; i<n; i++) scanf("%lf %lf", &pt[i].x, &pt[i].y);        solve(n, p, d);        printf("%.9lf %.9lf\n", p, d);    }    return 0;}
                                                                                                                      ^
0_0_20613444_18186.cpp: In function 'bool ok(double, int, double&)':
0_0_20613444_18186.cpp:3:388: error: 'pt' was not declared in this scope
     using namespace std; #define max(a,b) ((a)>=(b)?(a):(b)) const int maxn = 50000; struct node{    double x, y;}pt[maxn+5]; bool set(double &tl, double &tr, double cl, double cr){    if (cl>tr || tl>cr) return false;    if (tr>cr) tr = cr;    if (tl<cl) tl = cl;    return true;} bool ok(double r, int n, double &p){    int i;    double r2 = r*r;    double td, tl, tr;    td = sqrt(r2-pt[0].y*pt[0].y);    tl = pt[0].x - td;    tr = pt[0].x + td;    for (i=1; i<n; i++)    {        td = sqrt(r2-pt[i].y*pt[i].y);        if (!set(tl, tr, pt[i].x-td, pt[i].x+td))            return false;    }    p = (tl+tr)/2;    return true;} void solve(int n, double &p, double &d){    double low = 0, high = 3e5;    int i;    for (i=0; i<n; i++) low = max(low, fabs(pt[i].y));    double mid;    while(fabs(high-low)>1e-9)    {        mid = (low+high)/2;        if (ok(mid, n, p))        {            d = mid;            high = mid;        }        else low = mid;    }} int main(){    int n;    int i;    double p, d;    while(scanf("%d", &n)!=EOF)    {        if (n==0) break;        for (i=0; i<n; i++) scanf("%lf %lf", &pt[i].x, &pt[i].y);        solve(n, p, d);        printf("%.9lf %.9lf\n", p, d);    }    return 0;}
                                                                                                                                                                                                                                                                                                                                                                                                    ^
0_0_20613444_18186.cpp: In function 'void solve(int, double&, double&)':
0_0_20613444_18186.cpp:3:755: error: 'pt' was not declared in this scope
     using namespace std; #define max(a,b) ((a)>=(b)?(a):(b)) const int maxn = 50000; struct node{    double x, y;}pt[maxn+5]; bool set(double &tl, double &tr, double cl, double cr){    if (cl>tr || tl>cr) return false;    if (tr>cr) tr = cr;    if (tl<cl) tl = cl;    return true;} bool ok(double r, int n, double &p){    int i;    double r2 = r*r;    double td, tl, tr;    td = sqrt(r2-pt[0].y*pt[0].y);    tl = pt[0].x - td;    tr = pt[0].x + td;    for (i=1; i<n; i++)    {        td = sqrt(r2-pt[i].y*pt[i].y);        if (!set(tl, tr, pt[i].x-td, pt[i].x+td))            return false;    }    p = (tl+tr)/2;    return true;} void solve(int n, double &p, double &d){    double low = 0, high = 3e5;    int i;    for (i=0; i<n; i++) low = max(low, fabs(pt[i].y));    double mid;    while(fabs(high-low)>1e-9)    {        mid = (low+high)/2;        if (ok(mid, n, p))        {            d = mid;            high = mid;        }        else low = mid;    }} int main(){    int n;    int i;    double p, d;    while(scanf("%d", &n)!=EOF)    {        if (n==0) break;        for (i=0; i<n; i++) scanf("%lf %lf", &pt[i].x, &pt[i].y);        solve(n, p, d);        printf("%.9lf %.9lf\n", p, d);    }    return 0;}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   ^
0_0_20613444_18186.cpp: In function 'int main()':
0_0_20613444_18186.cpp:3:1112: error: 'pt' was not declared in this scope
     using namespace std; #define max(a,b) ((a)>=(b)?(a):(b)) const int maxn = 50000; struct node{    double x, y;}pt[maxn+5]; bool set(double &tl, double &tr, double cl, double cr){    if (cl>tr || tl>cr) return false;    if (tr>cr) tr = cr;    if (tl<cl) tl = cl;    return true;} bool ok(double r, int n, double &p){    int i;    double r2 = r*r;    double td, tl, tr;    td = sqrt(r2-pt[0].y*pt[0].y);    tl = pt[0].x - td;    tr = pt[0].x + td;    for (i=1; i<n; i++)    {        td = sqrt(r2-pt[i].y*pt[i].y);        if (!set(tl, tr, pt[i].x-td, pt[i].x+td))            return false;    }    p = (tl+tr)/2;    return true;} void solve(int n, double &p, double &d){    double low = 0, high = 3e5;    int i;    for (i=0; i<n; i++) low = max(low, fabs(pt[i].y));    double mid;    while(fabs(high-low)>1e-9)    {        mid = (low+high)/2;        if (ok(mid, n, p))        {            d = mid;            high = mid;        }        else low = mid;    }} int main(){    int n;    int i;    double p, d;    while(scanf("%d", &n)!=EOF)    {        if (n==0) break;        for (i=0; i<n; i++) scanf("%lf %lf", &pt[i].x, &pt[i].y);        solve(n, p, d);        printf("%.9lf %.9lf\n", p, d);    }    return 0;}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              


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-17 08:24:09, Gzip enabled