Submission #738433

# Submission time Handle Problem Language Result Execution time Memory
738433 2023-05-08T18:43:10 Z LKR__enjoyer Mobile (BOI12_mobile) C++17
0 / 100
1000 ms 73920 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<50;i++)
    {
        ld mid=lo+(hi-lo)/2; 
        if(spr(mid))hi=mid; else lo=mid+0.000001;
    }
    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(9)<<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 1 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 11 ms 596 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 25 ms 976 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 25 ms 976 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 12 ms 1204 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 204 ms 13804 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 452 ms 9228 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1064 ms 14868 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1068 ms 15600 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1066 ms 15676 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1064 ms 53616 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1044 ms 53536 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1080 ms 70924 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1078 ms 70812 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1059 ms 71680 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1073 ms 71580 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1072 ms 72436 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1072 ms 72356 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1070 ms 73920 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1085 ms 73872 KB Time limit exceeded
2 Halted 0 ms 0 KB -