답안 #738461

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
738461 2023-05-08T19:39:13 Z LKR__enjoyer Mobile (BOI12_mobile) C++17
50 / 100
1000 ms 57668 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)/2; 
        if(spr(mid))hi=mid; else lo=mid;
    }
    return lo;
}

int main()
{  ios_base::sync_with_stdio();
 cin.tie();
    cin>>n>>l;
    for(int i=0;i<n;i++)
    {int a,b; cin>>a>>b;
    pkt.pb({a,b});    
    }
    cout<<fixed<<setprecision(4)<<bin(0,(ld)(2*l));
    
    return 0;
}
bool spr(ld rad){
vector<pair<ld,ld>> pts={};
for(auto p : pkt)
{
    ld x=(ld)p.f,y=(ld)p.s;
    if(rad<abs(y))continue; 
    ld del=(ld)sqrt(rad*rad-y*y);
    ld x1=x-del,x2=x+del; 
    pts.pb({x1,x2});
}
if(pts.empty())return 0;
ld curr_min=1.5e9+1,curr_max=-1.5e9-1;
for(auto i : pts)
{ ld a=i.f,b=i.s; if(b<0)continue; 
if(curr_min==1.5e9+1&&curr_max==-1.5e9-1){curr_min=a; curr_max=b; continue;}
if(a<=curr_max)curr_max=max(curr_max,b);
if(b>=curr_min)curr_min=min(curr_min,a);
}
if(curr_min>0||curr_max<(ld)l)return 0;
return 1;    
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 468 KB Output is correct
2 Correct 5 ms 544 KB Output is correct
3 Correct 2 ms 340 KB Output is correct
4 Correct 5 ms 532 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 724 KB Output is correct
2 Correct 10 ms 752 KB Output is correct
3 Correct 6 ms 724 KB Output is correct
4 Correct 6 ms 724 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 724 KB Output is correct
2 Correct 12 ms 788 KB Output is correct
3 Correct 6 ms 724 KB Output is correct
4 Correct 5 ms 616 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 11 ms 756 KB Output is correct
2 Correct 11 ms 752 KB Output is correct
3 Correct 6 ms 724 KB Output is correct
4 Correct 6 ms 724 KB Output is correct
5 Correct 4 ms 724 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 137 ms 7452 KB Output is correct
2 Correct 188 ms 7492 KB Output is correct
3 Correct 101 ms 4172 KB Output is correct
4 Correct 64 ms 5052 KB Output is correct
5 Correct 37 ms 2828 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 65 ms 5088 KB Output is correct
2 Correct 48 ms 5056 KB Output is correct
3 Correct 60 ms 5144 KB Output is correct
4 Correct 77 ms 5096 KB Output is correct
5 Correct 71 ms 5160 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 202 ms 7928 KB Output is correct
2 Correct 199 ms 7712 KB Output is correct
3 Correct 111 ms 7148 KB Output is correct
4 Correct 113 ms 5196 KB Output is correct
5 Correct 60 ms 5232 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 227 ms 8424 KB Output is correct
2 Correct 268 ms 8492 KB Output is correct
3 Correct 199 ms 7572 KB Output is correct
4 Correct 100 ms 5300 KB Output is correct
5 Correct 70 ms 5256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 236 ms 8432 KB Output is correct
2 Correct 278 ms 8428 KB Output is correct
3 Correct 213 ms 7692 KB Output is correct
4 Correct 105 ms 5280 KB Output is correct
5 Correct 77 ms 5204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1075 ms 36644 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1074 ms 36540 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1051 ms 54604 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1082 ms 54440 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1045 ms 55340 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1078 ms 55204 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1067 ms 55968 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1070 ms 55840 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1076 ms 57436 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1067 ms 57668 KB Time limit exceeded
2 Halted 0 ms 0 KB -