Submission #684371

# Submission time Handle Problem Language Result Execution time Memory
684371 2023-01-21T05:00:51 Z handlename Mobile (BOI12_mobile) C++17
8 / 100
774 ms 31624 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=3e9;
	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<<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 1 ms 340 KB Output is correct
4 Correct 0 ms 340 KB Output is correct
# Verdict Execution time Memory 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 1 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 468 KB Output is correct
2 Incorrect 4 ms 508 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 452 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 61 ms 2688 KB Output is correct
2 Incorrect 59 ms 2656 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 50 ms 2776 KB Output is correct
2 Correct 46 ms 2532 KB Output is correct
3 Incorrect 78 ms 2764 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 67 ms 3068 KB Output is correct
2 Incorrect 63 ms 2908 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 82 ms 3464 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 83 ms 3360 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 356 ms 15984 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 432 ms 15984 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 426 ms 19120 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 496 ms 19020 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 505 ms 22248 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 566 ms 22224 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 576 ms 25384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 637 ms 25380 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 723 ms 31624 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 774 ms 31624 KB Output isn't correct
2 Halted 0 ms 0 KB -