Submission #684372

# Submission time Handle Problem Language Result Execution time Memory
684372 2023-01-21T05:02:47 Z handlename Mobile (BOI12_mobile) C++17
100 / 100
828 ms 50992 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=1.5e9;
	while (mini+eps<maxi){
		long double mid=(mini+maxi)/2;
		long double cur=0;
		for (int i=1;i<=n;i++){
			if (mid*mid<y[i]*y[i]) continue;
			long double lol=sqrt(mid*mid-y[i]*y[i]);
			if (x[i]-lol<=cur) cur=max(cur,x[i]+lol);
		}
		if (cur>=l) 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();
    }
}
# Verdict Execution time Memory 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
# Verdict Execution time Memory Grader output
1 Correct 0 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
# Verdict Execution time Memory Grader output
1 Correct 2 ms 340 KB Output is correct
2 Correct 2 ms 340 KB Output is correct
3 Correct 2 ms 392 KB Output is correct
4 Correct 2 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 504 KB Output is correct
2 Correct 6 ms 500 KB Output is correct
3 Correct 4 ms 468 KB Output is correct
4 Correct 4 ms 468 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 424 KB Output is correct
2 Correct 5 ms 468 KB Output is correct
3 Correct 3 ms 468 KB Output is correct
4 Correct 4 ms 464 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 500 KB Output is correct
2 Correct 5 ms 468 KB Output is correct
3 Correct 4 ms 468 KB Output is correct
4 Correct 4 ms 468 KB Output is correct
5 Correct 3 ms 468 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 64 ms 2608 KB Output is correct
2 Correct 60 ms 2612 KB Output is correct
3 Correct 35 ms 2644 KB Output is correct
4 Correct 50 ms 3864 KB Output is correct
5 Correct 28 ms 2248 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 47 ms 2776 KB Output is correct
2 Correct 43 ms 2512 KB Output is correct
3 Correct 53 ms 2892 KB Output is correct
4 Correct 52 ms 4004 KB Output is correct
5 Correct 57 ms 4492 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 59 ms 3076 KB Output is correct
2 Correct 62 ms 2808 KB Output is correct
3 Correct 56 ms 3944 KB Output is correct
4 Correct 70 ms 4968 KB Output is correct
5 Correct 54 ms 4044 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 80 ms 3496 KB Output is correct
2 Correct 78 ms 4848 KB Output is correct
3 Correct 65 ms 4492 KB Output is correct
4 Correct 70 ms 4868 KB Output is correct
5 Correct 62 ms 4720 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 82 ms 3360 KB Output is correct
2 Correct 76 ms 4584 KB Output is correct
3 Correct 67 ms 4428 KB Output is correct
4 Correct 70 ms 4992 KB Output is correct
5 Correct 66 ms 4736 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 355 ms 15984 KB Output is correct
2 Correct 381 ms 23708 KB Output is correct
3 Correct 392 ms 23348 KB Output is correct
4 Correct 350 ms 25560 KB Output is correct
5 Correct 326 ms 22868 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 395 ms 15908 KB Output is correct
2 Correct 453 ms 17480 KB Output is correct
3 Correct 333 ms 21752 KB Output is correct
4 Correct 391 ms 25284 KB Output is correct
5 Correct 353 ms 23244 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 418 ms 19132 KB Output is correct
2 Correct 467 ms 28468 KB Output is correct
3 Correct 463 ms 27832 KB Output is correct
4 Correct 426 ms 31220 KB Output is correct
5 Correct 388 ms 27176 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 475 ms 19000 KB Output is correct
2 Correct 514 ms 20640 KB Output is correct
3 Correct 412 ms 25948 KB Output is correct
4 Correct 437 ms 30924 KB Output is correct
5 Correct 399 ms 27852 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 511 ms 22396 KB Output is correct
2 Correct 545 ms 33100 KB Output is correct
3 Correct 537 ms 32364 KB Output is correct
4 Correct 493 ms 35800 KB Output is correct
5 Correct 463 ms 31236 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 540 ms 22236 KB Output is correct
2 Correct 606 ms 23720 KB Output is correct
3 Correct 554 ms 30640 KB Output is correct
4 Correct 514 ms 35564 KB Output is correct
5 Correct 464 ms 32280 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 660 ms 25376 KB Output is correct
2 Correct 636 ms 37804 KB Output is correct
3 Correct 662 ms 36908 KB Output is correct
4 Correct 669 ms 41036 KB Output is correct
5 Correct 583 ms 36524 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 705 ms 25384 KB Output is correct
2 Correct 706 ms 26760 KB Output is correct
3 Correct 588 ms 34904 KB Output is correct
4 Correct 644 ms 40756 KB Output is correct
5 Correct 582 ms 36984 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 731 ms 31536 KB Output is correct
2 Correct 807 ms 47180 KB Output is correct
3 Correct 788 ms 46200 KB Output is correct
4 Correct 743 ms 50848 KB Output is correct
5 Correct 688 ms 45200 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 812 ms 31628 KB Output is correct
2 Correct 828 ms 33040 KB Output is correct
3 Correct 708 ms 43816 KB Output is correct
4 Correct 733 ms 50992 KB Output is correct
5 Correct 689 ms 46284 KB Output is correct