답안 #738462

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
738462 2023-05-08T19:41:59 Z LKR__enjoyer Mobile (BOI12_mobile) C++17
100 / 100
551 ms 12836 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(false);
 cin.tie(0);
    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){

ld curr_min=1.5e9+1,curr_max=-1.5e9-1;
for(int i=0;i<n;i++)
{   ld x=(ld)pkt[i].f,y=(ld)pkt[i].s;
    if(rad<abs(y))continue; 
    ld del=(ld)sqrt(rad*rad-y*y);
    ld a=x-del,b=x+del; 
    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 1 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 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 340 KB Output is correct
2 Correct 3 ms 384 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 2 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 340 KB Output is correct
2 Correct 3 ms 340 KB Output is correct
3 Correct 3 ms 340 KB Output is correct
4 Correct 2 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 340 KB Output is correct
2 Correct 3 ms 340 KB Output is correct
3 Correct 3 ms 340 KB Output is correct
4 Correct 2 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 340 KB Output is correct
2 Correct 4 ms 340 KB Output is correct
3 Correct 3 ms 340 KB Output is correct
4 Correct 2 ms 340 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 36 ms 1492 KB Output is correct
2 Correct 41 ms 1448 KB Output is correct
3 Correct 23 ms 856 KB Output is correct
4 Correct 21 ms 1492 KB Output is correct
5 Correct 10 ms 856 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 20 ms 1480 KB Output is correct
2 Correct 19 ms 1444 KB Output is correct
3 Correct 21 ms 1492 KB Output is correct
4 Correct 23 ms 1492 KB Output is correct
5 Correct 24 ms 1492 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 42 ms 1464 KB Output is correct
2 Correct 44 ms 1492 KB Output is correct
3 Correct 35 ms 1492 KB Output is correct
4 Correct 29 ms 1492 KB Output is correct
5 Correct 21 ms 1468 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 53 ms 1468 KB Output is correct
2 Correct 53 ms 1400 KB Output is correct
3 Correct 42 ms 1408 KB Output is correct
4 Correct 36 ms 1492 KB Output is correct
5 Correct 26 ms 1492 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 46 ms 1492 KB Output is correct
2 Correct 53 ms 1480 KB Output is correct
3 Correct 46 ms 1492 KB Output is correct
4 Correct 33 ms 1376 KB Output is correct
5 Correct 25 ms 1404 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 251 ms 4476 KB Output is correct
2 Correct 269 ms 8324 KB Output is correct
3 Correct 256 ms 8492 KB Output is correct
4 Correct 148 ms 8296 KB Output is correct
5 Correct 134 ms 8844 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 263 ms 4512 KB Output is correct
2 Correct 259 ms 4916 KB Output is correct
3 Correct 200 ms 4868 KB Output is correct
4 Correct 138 ms 4928 KB Output is correct
5 Correct 127 ms 4848 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 283 ms 8588 KB Output is correct
2 Correct 332 ms 12488 KB Output is correct
3 Correct 311 ms 12704 KB Output is correct
4 Correct 193 ms 12244 KB Output is correct
5 Correct 162 ms 12604 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 316 ms 8540 KB Output is correct
2 Correct 319 ms 12568 KB Output is correct
3 Correct 242 ms 12708 KB Output is correct
4 Correct 179 ms 12096 KB Output is correct
5 Correct 152 ms 12340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 321 ms 8584 KB Output is correct
2 Correct 368 ms 12340 KB Output is correct
3 Correct 369 ms 12648 KB Output is correct
4 Correct 214 ms 11228 KB Output is correct
5 Correct 173 ms 12448 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 370 ms 9292 KB Output is correct
2 Correct 342 ms 12544 KB Output is correct
3 Correct 294 ms 12388 KB Output is correct
4 Correct 209 ms 11756 KB Output is correct
5 Correct 191 ms 11568 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 406 ms 9528 KB Output is correct
2 Correct 431 ms 12184 KB Output is correct
3 Correct 430 ms 12412 KB Output is correct
4 Correct 235 ms 12332 KB Output is correct
5 Correct 206 ms 11648 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 421 ms 9616 KB Output is correct
2 Correct 426 ms 12604 KB Output is correct
3 Correct 346 ms 12716 KB Output is correct
4 Correct 242 ms 12836 KB Output is correct
5 Correct 205 ms 12484 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 483 ms 9716 KB Output is correct
2 Correct 551 ms 12688 KB Output is correct
3 Correct 501 ms 12772 KB Output is correct
4 Correct 290 ms 8880 KB Output is correct
5 Correct 269 ms 12708 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 546 ms 8712 KB Output is correct
2 Correct 458 ms 12716 KB Output is correct
3 Correct 426 ms 12720 KB Output is correct
4 Correct 285 ms 8780 KB Output is correct
5 Correct 266 ms 12756 KB Output is correct