Submission #168854

# Submission time Handle Problem Language Result Execution time Memory
168854 2019-12-16T16:59:48 Z Uzumaki_Naturoo Mobile (BOI12_mobile) C++17
0 / 100
1000 ms 8196 KB
/// I’m not gonna run away,
/// I never go back on my word!
/// That’s my nindo: my ninja way.
/// ICPC next year

#include<bits/stdc++.h>
using namespace std ;
const int N = 1e6+5 ;
int n ,l ,x[N] ,y[N] ;
long double distance(long double x1,long double y1,long double x2,long double y2){
    return 1ll*(x2-x1)*(x2-x1) + 1ll*(y2-y1)*(y2-y1) ;
}
int main(){
    cin >> n >> l ;
    for(int i=0;i<n;++i) cin >> x[i] >> y[i];
    long double best1 = -1e18 ,best2 = -1e18 ;
    int p1 = 0 ,p2 = 0 ;
    for(int i=0;i<n;++i){
        long double d = distance(0,0,x[i],y[i]);
        if(d>best1) best1 = d ,p1 = i ;
        d = distance(l,0,x[i],y[i]);
        if(d>best2) best2 = d ,p2 = i ;
    }
    long long a = 1ll*x[p1]*x[p1] - 1ll*x[p2]*x[p2] + 1ll*y[p1]*y[p1] - 1ll*y[p2]*y[p2] ;
    long long b = 2ll * (x[p1] - x[p2]) ;
    long double x0 = 1.0 * a / b ;
    long double ans = 0 ;
    for(int i=0;i<n;++i) ans = max(ans ,distance(x0,0,x[i],y[i]));
    cout << fixed << setprecision(6) << sqrtl(ans) << endl ;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 73 ms 924 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 69 ms 988 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 70 ms 1080 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 124 ms 1108 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 124 ms 1132 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 411 ms 4280 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 643 ms 4288 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 507 ms 5016 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 774 ms 5096 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 592 ms 5756 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 898 ms 5864 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 678 ms 6612 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1030 ms 6576 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 820 ms 8196 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1075 ms 6880 KB Time limit exceeded
2 Halted 0 ms 0 KB -