Submission #168841

# Submission time Handle Problem Language Result Execution time Memory
168841 2019-12-16T16:24:46 Z MohamedAhmed04 Mobile (BOI12_mobile) C++14
100 / 100
946 ms 8312 KB
#include <bits/stdc++.h>
 
using namespace std ;
 
const int MAX = 1e6 + 10 ;
int x[MAX] , y[MAX] ;
int n , l;
double a , b , now;
 
bool check(double radius)
{
	now = 0.00 ;
	for(int i = 0 ; i < n ; ++i)
	{
		a = sqrt(radius * radius - ((-y[i] * 1ll) * (-y[i] * 1ll))) + x[i] * 1ll ;
		b = -sqrt(radius * radius - ((-y[i] * 1ll) * (-y[i] * 1ll))) + x[i] * 1ll ;
		if(a > b)
			swap(a , b) ;
		if(a <= now)
			now = max(now , b) ; 
	}
	return (now >= l) ;
}
 
int main()
{
	ios_base::sync_with_stdio(0) ;
	cin.tie(0) ;
	cin>>n>>l ;
	for(int i = 0 ; i < n ; ++i)
		cin>>x[i]>>y[i] ;
	double low = 0.000 , high = 1e9 ;
	double ans = high ;
	for(int i = 0 ; i < 40 ; ++i)
	{
		double mid = (low + high) / 2.00 ;
		if(check(mid))
			ans = mid , high = mid ;
		else
			low = mid ;
	}
	return cout<<fixed<<setprecision(6)<<ans<<"\n" , 0 ;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 380 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 376 KB Output is correct
2 Correct 3 ms 376 KB Output is correct
3 Correct 3 ms 380 KB Output is correct
4 Correct 3 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 380 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 5 ms 376 KB Output is correct
4 Correct 6 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 376 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 5 ms 376 KB Output is correct
4 Correct 6 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 376 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 5 ms 404 KB Output is correct
4 Correct 6 ms 376 KB Output is correct
5 Correct 5 ms 380 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 56 ms 1016 KB Output is correct
2 Correct 46 ms 992 KB Output is correct
3 Correct 35 ms 760 KB Output is correct
4 Correct 66 ms 1016 KB Output is correct
5 Correct 35 ms 760 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 57 ms 888 KB Output is correct
2 Correct 55 ms 888 KB Output is correct
3 Correct 66 ms 1016 KB Output is correct
4 Correct 68 ms 1016 KB Output is correct
5 Correct 79 ms 1016 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 47 ms 1144 KB Output is correct
2 Correct 50 ms 1144 KB Output is correct
3 Correct 53 ms 1016 KB Output is correct
4 Correct 95 ms 1144 KB Output is correct
5 Correct 67 ms 1016 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 61 ms 1092 KB Output is correct
2 Correct 60 ms 1116 KB Output is correct
3 Correct 62 ms 1192 KB Output is correct
4 Correct 95 ms 1184 KB Output is correct
5 Correct 80 ms 1144 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 60 ms 1144 KB Output is correct
2 Correct 60 ms 1144 KB Output is correct
3 Correct 61 ms 1144 KB Output is correct
4 Correct 95 ms 1144 KB Output is correct
5 Correct 82 ms 1116 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 266 ms 4348 KB Output is correct
2 Correct 298 ms 4444 KB Output is correct
3 Correct 293 ms 4312 KB Output is correct
4 Correct 465 ms 4472 KB Output is correct
5 Correct 424 ms 4348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 310 ms 4220 KB Output is correct
2 Correct 392 ms 4356 KB Output is correct
3 Correct 310 ms 4316 KB Output is correct
4 Correct 460 ms 4344 KB Output is correct
5 Correct 413 ms 4304 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 320 ms 5088 KB Output is correct
2 Correct 357 ms 5112 KB Output is correct
3 Correct 352 ms 5092 KB Output is correct
4 Correct 579 ms 5112 KB Output is correct
5 Correct 483 ms 5212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 363 ms 5108 KB Output is correct
2 Correct 468 ms 5112 KB Output is correct
3 Correct 370 ms 5112 KB Output is correct
4 Correct 570 ms 5112 KB Output is correct
5 Correct 522 ms 4980 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 378 ms 5872 KB Output is correct
2 Correct 416 ms 5936 KB Output is correct
3 Correct 411 ms 5892 KB Output is correct
4 Correct 678 ms 5752 KB Output is correct
5 Correct 555 ms 5916 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 421 ms 5952 KB Output is correct
2 Correct 550 ms 5908 KB Output is correct
3 Correct 441 ms 5884 KB Output is correct
4 Correct 651 ms 5876 KB Output is correct
5 Correct 579 ms 5880 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 430 ms 6720 KB Output is correct
2 Correct 473 ms 6692 KB Output is correct
3 Correct 466 ms 6716 KB Output is correct
4 Correct 751 ms 6832 KB Output is correct
5 Correct 656 ms 6648 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 482 ms 6648 KB Output is correct
2 Correct 617 ms 6656 KB Output is correct
3 Correct 493 ms 6620 KB Output is correct
4 Correct 751 ms 6688 KB Output is correct
5 Correct 664 ms 6780 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 528 ms 8312 KB Output is correct
2 Correct 596 ms 8204 KB Output is correct
3 Correct 605 ms 8312 KB Output is correct
4 Correct 935 ms 8224 KB Output is correct
5 Correct 810 ms 8312 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 601 ms 8208 KB Output is correct
2 Correct 772 ms 8304 KB Output is correct
3 Correct 624 ms 8292 KB Output is correct
4 Correct 946 ms 8204 KB Output is correct
5 Correct 837 ms 8120 KB Output is correct