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_20612366_23598.cpp:4:26: error: stray '#' in program
     using namespace std ;#define M 100000 + 10#define eps 1e-4int A[M] ;int n ;int m ;int slove(double x){    int sum = 0 ;    double  d = A[0] ;    d += 2 * x ;    int i = 0 ;    ++ sum ;    while(d < A[m -1] * 1.0 )    {        while(A[i] <= d) ++ i ;        d = A[i] + 2 * x ;        sum ++ ;    }    return sum ;}double Find(double left , double right){    double mid ;    while(right - left >  eps)    {        mid = left + (right - left) / 2 ;        if(slove(mid) <= n)            right = mid  ;        else left = mid +eps   ;     }    return  left  ;}int main(){    int cas ;    double low ;    double high ;    double ans ;    while(scanf("%d",&cas) != EOF)    {        while(cas --)        {            scanf("%d%d",&n,&m) ;            for(int i = 0 ;i < m ; ++ i)                scanf("%d",&A[i]) ;            sort(A , A+ m) ;            low = 0 ;            high = A[m -1] * 1.0 / n  ;            ans = Find(low , high) ;            printf("%.1lf\n",ans) ;        }    }    return 0 ;}
                          ^
0_0_20612366_23598.cpp:4:47: error: stray '#' in program
     using namespace std ;#define M 100000 + 10#define eps 1e-4int A[M] ;int n ;int m ;int slove(double x){    int sum = 0 ;    double  d = A[0] ;    d += 2 * x ;    int i = 0 ;    ++ sum ;    while(d < A[m -1] * 1.0 )    {        while(A[i] <= d) ++ i ;        d = A[i] + 2 * x ;        sum ++ ;    }    return sum ;}double Find(double left , double right){    double mid ;    while(right - left >  eps)    {        mid = left + (right - left) / 2 ;        if(slove(mid) <= n)            right = mid  ;        else left = mid +eps   ;     }    return  left  ;}int main(){    int cas ;    double low ;    double high ;    double ans ;    while(scanf("%d",&cas) != EOF)    {        while(cas --)        {            scanf("%d%d",&n,&m) ;            for(int i = 0 ;i < m ; ++ i)                scanf("%d",&A[i]) ;            sort(A , A+ m) ;            low = 0 ;            high = A[m -1] * 1.0 / n  ;            ans = Find(low , high) ;            printf("%.1lf\n",ans) ;        }    }    return 0 ;}
                                               ^
0_0_20612366_23598.cpp:4:27: error: 'define' does not name a type
     using namespace std ;#define M 100000 + 10#define eps 1e-4int A[M] ;int n ;int m ;int slove(double x){    int sum = 0 ;    double  d = A[0] ;    d += 2 * x ;    int i = 0 ;    ++ sum ;    while(d < A[m -1] * 1.0 )    {        while(A[i] <= d) ++ i ;        d = A[i] + 2 * x ;        sum ++ ;    }    return sum ;}double Find(double left , double right){    double mid ;    while(right - left >  eps)    {        mid = left + (right - left) / 2 ;        if(slove(mid) <= n)            right = mid  ;        else left = mid +eps   ;     }    return  left  ;}int main(){    int cas ;    double low ;    double high ;    double ans ;    while(scanf("%d",&cas) != EOF)    {        while(cas --)        {            scanf("%d%d",&n,&m) ;            for(int i = 0 ;i < m ; ++ i)                scanf("%d",&A[i]) ;            sort(A , A+ m) ;            low = 0 ;            high = A[m -1] * 1.0 / n  ;            ans = Find(low , high) ;            printf("%.1lf\n",ans) ;        }    }    return 0 ;}
                           ^
0_0_20612366_23598.cpp: In function 'int slove(double)':
0_0_20612366_23598.cpp:4:140: error: 'A' was not declared in this scope
     using namespace std ;#define M 100000 + 10#define eps 1e-4int A[M] ;int n ;int m ;int slove(double x){    int sum = 0 ;    double  d = A[0] ;    d += 2 * x ;    int i = 0 ;    ++ sum ;    while(d < A[m -1] * 1.0 )    {        while(A[i] <= d) ++ i ;        d = A[i] + 2 * x ;        sum ++ ;    }    return sum ;}double Find(double left , double right){    double mid ;    while(right - left >  eps)    {        mid = left + (right - left) / 2 ;        if(slove(mid) <= n)            right = mid  ;        else left = mid +eps   ;     }    return  left  ;}int main(){    int cas ;    double low ;    double high ;    double ans ;    while(scanf("%d",&cas) != EOF)    {        while(cas --)        {            scanf("%d%d",&n,&m) ;            for(int i = 0 ;i < m ; ++ i)                scanf("%d",&A[i]) ;            sort(A , A+ m) ;            low = 0 ;            high = A[m -1] * 1.0 / n  ;            ans = Find(low , high) ;            printf("%.1lf\n",ans) ;        }    }    return 0 ;}
                                                                                                                                            ^
0_0_20612366_23598.cpp: In function 'double Find(double, double)':
0_0_20612366_23598.cpp:4:400: error: 'eps' was not declared in this scope
     using namespace std ;#define M 100000 + 10#define eps 1e-4int A[M] ;int n ;int m ;int slove(double x){    int sum = 0 ;    double  d = A[0] ;    d += 2 * x ;    int i = 0 ;    ++ sum ;    while(d < A[m -1] * 1.0 )    {        while(A[i] <= d) ++ i ;        d = A[i] + 2 * x ;        sum ++ ;    }    return sum ;}double Find(double left , double right){    double mid ;    while(right - left >  eps)    {        mid = left + (right - left) / 2 ;        if(slove(mid) <= n)            right = mid  ;        else left = mid +eps   ;     }    return  left  ;}int main(){    int cas ;    double low ;    double high ;    double ans ;    while(scanf("%d",&cas) != EOF)    {        while(cas --)        {            scanf("%d%d",&n,&m) ;            for(int i = 0 ;i < m ; ++ i)                scanf("%d",&A[i]) ;            sort(A , A+ m) ;            low = 0 ;            high = A[m -1] * 1.0 / n  ;            ans = Find(low , high) ;            printf("%.1lf\n",ans) ;        }    }    return 0 ;}
                                                                                                                                                                                                                                                                                                                                                                                                                ^
0_0_20612366_23598.cpp: In function 'int main()':
0_0_20612366_23598.cpp:4:804: error: 'A' was not declared in this scope
     using namespace std ;#define M 100000 + 10#define eps 1e-4int A[M] ;int n ;int m ;int slove(double x){    int sum = 0 ;    double  d = A[0] ;    d += 2 * x ;    int i = 0 ;    ++ sum ;    while(d < A[m -1] * 1.0 )    {        while(A[i] <= d) ++ i ;        d = A[i] + 2 * x ;        sum ++ ;    }    return sum ;}double Find(double left , double right){    double mid ;    while(right - left >  eps)    {        mid = left + (right - left) / 2 ;        if(slove(mid) <= n)            right = mid  ;        else left = mid +eps   ;     }    return  left  ;}int main(){    int cas ;    double low ;    double high ;    double ans ;    while(scanf("%d",&cas) != EOF)    {        while(cas --)        {            scanf("%d%d",&n,&m) ;            for(int i = 0 ;i < m ; ++ i)                scanf("%d",&A[i]) ;            sort(A , A+ m) ;            low = 0 ;            high = A[m -1] * 1.0 / n  ;            ans = Find(low , high) ;            printf("%.1lf\n",ans) ;        }    }    return 0 ;}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ^
0_0_20612366_23598.cpp:4:828: error: 'A' was not declared in this scope
     using namespace std ;#define M 100000 + 10#define eps 1e-4int A[M] ;int n ;int m ;int slove(double x){    int sum = 0 ;    double  d = A[0] ;    d += 2 * x ;    int i = 0 ;    ++ sum ;    while(d < A[m -1] * 1.0 )    {        while(A[i] <= d) ++ i ;        d = A[i] + 2 * x ;        sum ++ ;    }    return sum ;}double Find(double left , double right){    double mid ;    while(right - left >  eps)    {        mid = left + (right - left) / 2 ;        if(slove(mid) <= n)            right = mid  ;        else left = mid +eps   ;     }    return  left  ;}int main(){    int cas ;    double low ;    double high ;    double ans ;    while(scanf("%d",&cas) != EOF)    {        while(cas --)        {            scanf("%d%d",&n,&m) ;            for(int i = 0 ;i < m ; ++ i)                scanf("%d",&A[i]) ;            sort(A , A+ m) ;            low = 0 ;            high = A[m -1] * 1.0 / n  ;            ans = Find(low , high) ;            printf("%.1lf\n",ans) ;        }    }    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-27 07:58:07, Gzip enabled