Submission #684367

# Submission time Handle Problem Language Result Execution time Memory
684367 2023-01-21T04:53:50 Z handlename Mobile (BOI12_mobile) C++17
8 / 100
850 ms 31628 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++){
			if (mid*mid<y[i]*y[i]) continue;
			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();
    }
}
# Verdict Execution time Memory Grader output
1 Correct 1 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 1 ms 340 KB Output is correct
# 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 1 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 340 KB Output is correct
4 Incorrect 2 ms 340 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 504 KB Output is correct
2 Incorrect 4 ms 468 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory 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 -
# Verdict Execution time Memory 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 -
# Verdict Execution time Memory Grader output
1 Correct 60 ms 2676 KB Output is correct
2 Incorrect 60 ms 2732 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 56 ms 2772 KB Output is correct
2 Correct 46 ms 2536 KB Output is correct
3 Incorrect 53 ms 2876 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 61 ms 3020 KB Output is correct
2 Incorrect 75 ms 2852 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 82 ms 3408 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 90 ms 3472 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 374 ms 15980 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 420 ms 15976 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 452 ms 19024 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 488 ms 19156 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 520 ms 22240 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 559 ms 22320 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 597 ms 25308 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 679 ms 25380 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 732 ms 31628 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 850 ms 31628 KB Output isn't correct
2 Halted 0 ms 0 KB -