답안 #684366

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
684366 2023-01-21T04:49:37 Z handlename Mobile (BOI12_mobile) C++17
8 / 100
788 ms 31740 KB
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define float long double
const int MOD=1e9+7;
//const int MOD=998244353;
const int sqn=450;
const long double eps=1e-6;
long double n,l,x[1000002],y[1000002];
void runtc(){
	cin>>n>>l;
	for (int i=1;i<=n;i++){
		cin>>x[i]>>y[i];
	}
	long double mini=0,maxi=1e10;
	while (mini+eps<maxi){
		long double mid=(mini+maxi)/2;
		long double cur=0;
		for (int i=1;i<=n;i++){
			long double lol=sqrt(mid*mid-y[i]*y[i]);
			if (x[i]-lol<=cur+eps) cur=max(cur,x[i]+lol);
		}
		if (cur>=l-eps) maxi=mid;
		else mini=mid;
	}
	cout<<maxi;
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    //freopen("moocast.in","r",stdin);
    //freopen("moocast.out","w",stdout);
    //freopen("input1.in","r",stdin);
    //freopen("output1.out","w",stdout);
    //freopen("perfectly_balanced_chapter_1_input.txt","r",stdin);
    //freopen("hackercup_output.txt","w",stdout);
    int tc;
    //cin>>tc;
    tc=1;
    for (int i=1;i<=tc;i++){
        //cout<<"Case #"<<i<<": ";
        runtc();
    }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 0 ms 340 KB Output is correct
3 Correct 0 ms 340 KB Output is correct
4 Correct 0 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 0 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 468 KB Output is correct
2 Correct 3 ms 340 KB Output is correct
3 Correct 3 ms 340 KB Output is correct
4 Incorrect 2 ms 340 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 468 KB Output is correct
2 Incorrect 4 ms 468 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 504 KB Output is correct
2 Incorrect 4 ms 468 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 468 KB Output is correct
2 Incorrect 4 ms 468 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 107 ms 2668 KB Output is correct
2 Incorrect 67 ms 2720 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 93 ms 2772 KB Output is correct
2 Correct 98 ms 2464 KB Output is correct
3 Incorrect 103 ms 2876 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 67 ms 3160 KB Output is correct
2 Incorrect 63 ms 2964 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 80 ms 3464 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 80 ms 3456 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 364 ms 15984 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 401 ms 15988 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 447 ms 19224 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 477 ms 19020 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 514 ms 22248 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 592 ms 22140 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 578 ms 25480 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 654 ms 25384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 757 ms 31740 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 788 ms 31628 KB Output isn't correct
2 Halted 0 ms 0 KB -