Submission #973949

# Submission time Handle Problem Language Result Execution time Memory
973949 2024-05-02T13:19:09 Z andrewp Mobile (BOI12_mobile) C++17
50 / 100
52 ms 3520 KB
//Dedicated to my love,ivaziva
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define dbg(x) cerr<<#x<<": "<<x<<endl;
#define pb push_back
#define fi first
#define se second
#define mp make_pair
#define mt make_tuple
#define pii pair<int,int>
#define pll pair<ll,ll>
#define ldb double
const ll inf=(ll)1e18+5;
const int mod=1e9+7;
const int K=512;
const int L=30;
const int N=1e5+1;
int n,l;
pll a[N];
int main()
{
    ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin>>n>>l;
	for(int i=0;i<n;i++) cin>>a[i].fi>>a[i].se;
	ldb bot=1.00,top=(ldb)1.5e9;
	while(top-bot>0.0000001)
    {
		ldb mid=(bot+top)/2,calc=0;
		for(int i=0;i<n;i++)
		{
			ldb razl=sqrt((ldb)(mid*mid)-(ldb)(a[i].se*a[i].se));
			ldb x=(ldb)a[i].fi-razl;
			ldb y=(ldb)a[i].fi+razl;
			if(x<=calc)
            {
                calc=max(calc,y);
            }
		}
		if(calc>=l) top=mid;
		else bot=mid;
	}
	cout<<fixed<<setprecision(6)<<bot;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 468 KB Output is correct
3 Correct 1 ms 464 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 468 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 432 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 348 KB Output is correct
2 Correct 2 ms 604 KB Output is correct
3 Correct 2 ms 348 KB Output is correct
4 Correct 3 ms 604 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 344 KB Output is correct
2 Correct 2 ms 604 KB Output is correct
3 Correct 2 ms 348 KB Output is correct
4 Correct 2 ms 604 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 348 KB Output is correct
2 Correct 2 ms 604 KB Output is correct
3 Correct 2 ms 348 KB Output is correct
4 Correct 3 ms 604 KB Output is correct
5 Correct 2 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 35 ms 2648 KB Output is correct
2 Correct 23 ms 2384 KB Output is correct
3 Correct 16 ms 1628 KB Output is correct
4 Correct 29 ms 2384 KB Output is correct
5 Correct 15 ms 1628 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 31 ms 2164 KB Output is correct
2 Correct 27 ms 2140 KB Output is correct
3 Correct 33 ms 2392 KB Output is correct
4 Correct 39 ms 2396 KB Output is correct
5 Correct 34 ms 2768 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 22 ms 2136 KB Output is correct
2 Correct 24 ms 2496 KB Output is correct
3 Correct 24 ms 2396 KB Output is correct
4 Correct 41 ms 3164 KB Output is correct
5 Correct 37 ms 2600 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 29 ms 2908 KB Output is correct
2 Correct 29 ms 2904 KB Output is correct
3 Correct 28 ms 2792 KB Output is correct
4 Correct 52 ms 3520 KB Output is correct
5 Correct 35 ms 2648 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 33 ms 2904 KB Output is correct
2 Correct 28 ms 2908 KB Output is correct
3 Correct 28 ms 2652 KB Output is correct
4 Correct 41 ms 3152 KB Output is correct
5 Correct 49 ms 2764 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 10 ms 2672 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 15 ms 3216 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 10 ms 2652 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 14 ms 3240 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 10 ms 2652 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 17 ms 3292 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 16 ms 2784 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 22 ms 3152 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 11 ms 2652 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 17 ms 3292 KB Output isn't correct
2 Halted 0 ms 0 KB -