Submission #973952

# Submission time Handle Problem Language Result Execution time Memory
973952 2024-05-02T13:21:12 Z andrewp Mobile (BOI12_mobile) C++14
100 / 100
341 ms 35432 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=1e6+1;
ll 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>1e-3)
    {
		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>=(ldb)l) top=mid;
		else bot=mid;
	}
	cout<<fixed<<setprecision(4)<<bot;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 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 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 2 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 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 2 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 2 ms 348 KB Output is correct
3 Correct 2 ms 348 KB Output is correct
4 Correct 2 ms 348 KB Output is correct
5 Correct 2 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 24 ms 2652 KB Output is correct
2 Correct 19 ms 2652 KB Output is correct
3 Correct 15 ms 2692 KB Output is correct
4 Correct 27 ms 2904 KB Output is correct
5 Correct 12 ms 2652 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 21 ms 2652 KB Output is correct
2 Correct 23 ms 2652 KB Output is correct
3 Correct 23 ms 2648 KB Output is correct
4 Correct 25 ms 2652 KB Output is correct
5 Correct 27 ms 2696 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 22 ms 2652 KB Output is correct
2 Correct 20 ms 2696 KB Output is correct
3 Correct 19 ms 2652 KB Output is correct
4 Correct 32 ms 2648 KB Output is correct
5 Correct 29 ms 2652 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 24 ms 2652 KB Output is correct
2 Correct 23 ms 2652 KB Output is correct
3 Correct 23 ms 2692 KB Output is correct
4 Correct 32 ms 2904 KB Output is correct
5 Correct 29 ms 2708 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 24 ms 2652 KB Output is correct
2 Correct 23 ms 2652 KB Output is correct
3 Correct 23 ms 2652 KB Output is correct
4 Correct 32 ms 2696 KB Output is correct
5 Correct 27 ms 2652 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 106 ms 12108 KB Output is correct
2 Correct 124 ms 16468 KB Output is correct
3 Correct 120 ms 16040 KB Output is correct
4 Correct 159 ms 18256 KB Output is correct
5 Correct 152 ms 15444 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 122 ms 14932 KB Output is correct
2 Correct 183 ms 15184 KB Output is correct
3 Correct 121 ms 14572 KB Output is correct
4 Correct 163 ms 18148 KB Output is correct
5 Correct 163 ms 15976 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 134 ms 14964 KB Output is correct
2 Correct 146 ms 20144 KB Output is correct
3 Correct 147 ms 19432 KB Output is correct
4 Correct 222 ms 22752 KB Output is correct
5 Correct 169 ms 18856 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 151 ms 18768 KB Output is correct
2 Correct 214 ms 18804 KB Output is correct
3 Correct 142 ms 17748 KB Output is correct
4 Correct 193 ms 22596 KB Output is correct
5 Correct 172 ms 19540 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 180 ms 17964 KB Output is correct
2 Correct 168 ms 23536 KB Output is correct
3 Correct 170 ms 22900 KB Output is correct
4 Correct 284 ms 26452 KB Output is correct
5 Correct 198 ms 21840 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 173 ms 22356 KB Output is correct
2 Correct 245 ms 22176 KB Output is correct
3 Correct 167 ms 21304 KB Output is correct
4 Correct 267 ms 26296 KB Output is correct
5 Correct 212 ms 23436 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 167 ms 21112 KB Output is correct
2 Correct 196 ms 27380 KB Output is correct
3 Correct 193 ms 26452 KB Output is correct
4 Correct 276 ms 30620 KB Output is correct
5 Correct 236 ms 26196 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 200 ms 26496 KB Output is correct
2 Correct 281 ms 25464 KB Output is correct
3 Correct 186 ms 24404 KB Output is correct
4 Correct 261 ms 30448 KB Output is correct
5 Correct 243 ms 26352 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 207 ms 23672 KB Output is correct
2 Correct 281 ms 31468 KB Output is correct
3 Correct 234 ms 30436 KB Output is correct
4 Correct 328 ms 35156 KB Output is correct
5 Correct 292 ms 29756 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 253 ms 30548 KB Output is correct
2 Correct 339 ms 27776 KB Output is correct
3 Correct 237 ms 28244 KB Output is correct
4 Correct 341 ms 35432 KB Output is correct
5 Correct 298 ms 30816 KB Output is correct