답안 #684375

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
684375 2023-01-21T05:04:07 Z handlename Mobile (BOI12_mobile) C++17
80 / 100
1000 ms 31728 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-4;
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=2e9;
	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<<fixed<<setprecision(4);
	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 1 ms 340 KB Output is correct
2 Correct 1 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 1 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 340 KB Output is correct
2 Correct 2 ms 340 KB Output is correct
3 Correct 2 ms 340 KB Output is correct
4 Correct 2 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 504 KB Output is correct
2 Correct 6 ms 468 KB Output is correct
3 Correct 5 ms 468 KB Output is correct
4 Correct 7 ms 468 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 468 KB Output is correct
2 Correct 4 ms 468 KB Output is correct
3 Correct 4 ms 468 KB Output is correct
4 Correct 7 ms 488 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 468 KB Output is correct
2 Correct 4 ms 468 KB Output is correct
3 Correct 5 ms 468 KB Output is correct
4 Correct 8 ms 508 KB Output is correct
5 Correct 9 ms 468 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 105 ms 2672 KB Output is correct
2 Correct 56 ms 2740 KB Output is correct
3 Correct 41 ms 2004 KB Output is correct
4 Correct 94 ms 2644 KB Output is correct
5 Correct 46 ms 1808 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 87 ms 2804 KB Output is correct
2 Correct 78 ms 2540 KB Output is correct
3 Correct 91 ms 2872 KB Output is correct
4 Correct 97 ms 2796 KB Output is correct
5 Correct 113 ms 3040 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 59 ms 3028 KB Output is correct
2 Correct 60 ms 2848 KB Output is correct
3 Correct 63 ms 2984 KB Output is correct
4 Correct 140 ms 3440 KB Output is correct
5 Correct 93 ms 3016 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 74 ms 3464 KB Output is correct
2 Correct 74 ms 3540 KB Output is correct
3 Correct 74 ms 3456 KB Output is correct
4 Correct 140 ms 3420 KB Output is correct
5 Correct 112 ms 3400 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 81 ms 3520 KB Output is correct
2 Correct 69 ms 3460 KB Output is correct
3 Correct 75 ms 3404 KB Output is correct
4 Correct 140 ms 3376 KB Output is correct
5 Correct 113 ms 3464 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 336 ms 15928 KB Output is correct
2 Correct 362 ms 16108 KB Output is correct
3 Correct 353 ms 16036 KB Output is correct
4 Correct 679 ms 16048 KB Output is correct
5 Correct 585 ms 16012 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 363 ms 16060 KB Output is correct
2 Correct 552 ms 15992 KB Output is correct
3 Correct 383 ms 15884 KB Output is correct
4 Correct 674 ms 16076 KB Output is correct
5 Correct 605 ms 15980 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 389 ms 19124 KB Output is correct
2 Correct 429 ms 19020 KB Output is correct
3 Correct 421 ms 19144 KB Output is correct
4 Correct 846 ms 19208 KB Output is correct
5 Correct 686 ms 19120 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 425 ms 19040 KB Output is correct
2 Correct 665 ms 19236 KB Output is correct
3 Correct 472 ms 19124 KB Output is correct
4 Correct 839 ms 19148 KB Output is correct
5 Correct 711 ms 19124 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 454 ms 22324 KB Output is correct
2 Correct 506 ms 22336 KB Output is correct
3 Correct 480 ms 22220 KB Output is correct
4 Correct 958 ms 22308 KB Output is correct
5 Correct 791 ms 22244 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 508 ms 22132 KB Output is correct
2 Correct 786 ms 22248 KB Output is correct
3 Correct 545 ms 22244 KB Output is correct
4 Correct 959 ms 22172 KB Output is correct
5 Correct 832 ms 22292 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 509 ms 25384 KB Output is correct
2 Correct 562 ms 25488 KB Output is correct
3 Correct 559 ms 25276 KB Output is correct
4 Execution timed out 1088 ms 25364 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 573 ms 25292 KB Output is correct
2 Correct 905 ms 25384 KB Output is correct
3 Correct 612 ms 25384 KB Output is correct
4 Execution timed out 1095 ms 25292 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 631 ms 31728 KB Output is correct
2 Correct 732 ms 31716 KB Output is correct
3 Correct 701 ms 31580 KB Output is correct
4 Execution timed out 1057 ms 31660 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 714 ms 31624 KB Output is correct
2 Execution timed out 1092 ms 31572 KB Time limit exceeded
3 Halted 0 ms 0 KB -