Submission #738434

# Submission time Handle Problem Language Result Execution time Memory
738434 2023-05-08T18:45:02 Z LKR__enjoyer Mobile (BOI12_mobile) C++17
0 / 100
1000 ms 73980 KB
#include <iostream>
#include<bits/stdc++.h>
#define pb push_back
#define f first
#define s second
typedef long long ll;
typedef long double ld;
using namespace std;
int n,l;
vector<pair<int,int>> pkt;
bool spr(long double rad);
long double bin(ld lo,ld hi)
{
    for(int i=0;i<40;i++)
    {
        ld mid=lo+(hi-lo)/2; 
        if(spr(mid))hi=mid; else lo=mid;
    }
    return lo;
}

int main()
{ 
    cin>>n>>l;
    for(int i=0;i<n;i++)
    {int a,b; cin>>a>>b;
    pkt.pb({a,b});    
    }
    cout<<setprecision(6)<<bin(0,(ld)2*l);
    
    return 0;
}
bool spr(ld rad){
vector<pair<ld,int>> pts={};
for(auto p : pkt)
{
    ld x=(ld)p.f,y=(ld)p.s;
    if(y>rad)continue; 
    ld x1=x-sqrt(rad*rad-y*y),x2=x+sqrt(rad*rad-y*y); 
    pts.pb({x1,-1});
    pts.pb({x2,1});
}
sort(pts.begin(),pts.end());  

if(pts[0].f>0||pts[pts.size()-1].f<(ld)l)return 0;    
int licz=0;
for(auto i : pts){if(i.f>(ld)l)break; int d=i.s*(-1); licz+=d; if(licz==0)return 0; }
return 1;    
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 10 ms 596 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 21 ms 976 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 23 ms 932 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 12 ms 1176 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 218 ms 13824 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 390 ms 9244 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1065 ms 14760 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1069 ms 15768 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 965 ms 15776 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1075 ms 53492 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1054 ms 53700 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1064 ms 70784 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1060 ms 70852 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1081 ms 71592 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1081 ms 71516 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1057 ms 72388 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1052 ms 72360 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1073 ms 73864 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1064 ms 73980 KB Time limit exceeded
2 Halted 0 ms 0 KB -