Submission #168839

# Submission time Handle Problem Language Result Execution time Memory
168839 2019-12-16T16:23:23 Z MohamedAhmed04 Mobile (BOI12_mobile) C++14
100 / 100
961 ms 8268 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 < 41 ; ++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 292 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
# 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 4 ms 376 KB Output is correct
2 Correct 3 ms 376 KB Output is correct
3 Correct 3 ms 376 KB Output is correct
4 Correct 3 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 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 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 376 KB Output is correct
4 Correct 6 ms 376 KB Output is correct
5 Correct 5 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 57 ms 888 KB Output is correct
2 Correct 48 ms 1016 KB Output is correct
3 Correct 35 ms 764 KB Output is correct
4 Correct 67 ms 1016 KB Output is correct
5 Correct 36 ms 760 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 58 ms 888 KB Output is correct
2 Correct 56 ms 1016 KB Output is correct
3 Correct 66 ms 1016 KB Output is correct
4 Correct 70 ms 1116 KB Output is correct
5 Correct 80 ms 1016 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 48 ms 1016 KB Output is correct
2 Correct 50 ms 1016 KB Output is correct
3 Correct 54 ms 1016 KB Output is correct
4 Correct 96 ms 1144 KB Output is correct
5 Correct 68 ms 1016 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 62 ms 1180 KB Output is correct
2 Correct 61 ms 1300 KB Output is correct
3 Correct 62 ms 1144 KB Output is correct
4 Correct 98 ms 1200 KB Output is correct
5 Correct 81 ms 1144 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 62 ms 1108 KB Output is correct
2 Correct 61 ms 1148 KB Output is correct
3 Correct 62 ms 1144 KB Output is correct
4 Correct 97 ms 1284 KB Output is correct
5 Correct 84 ms 1272 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 270 ms 4312 KB Output is correct
2 Correct 302 ms 4344 KB Output is correct
3 Correct 297 ms 4220 KB Output is correct
4 Correct 474 ms 4344 KB Output is correct
5 Correct 412 ms 4216 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 306 ms 4344 KB Output is correct
2 Correct 404 ms 4420 KB Output is correct
3 Correct 311 ms 4344 KB Output is correct
4 Correct 467 ms 4344 KB Output is correct
5 Correct 423 ms 4344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 326 ms 5188 KB Output is correct
2 Correct 362 ms 5096 KB Output is correct
3 Correct 356 ms 5112 KB Output is correct
4 Correct 580 ms 5128 KB Output is correct
5 Correct 493 ms 5100 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 370 ms 5104 KB Output is correct
2 Correct 481 ms 5184 KB Output is correct
3 Correct 376 ms 5240 KB Output is correct
4 Correct 575 ms 5112 KB Output is correct
5 Correct 509 ms 5240 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 377 ms 5876 KB Output is correct
2 Correct 422 ms 5932 KB Output is correct
3 Correct 415 ms 5880 KB Output is correct
4 Correct 664 ms 5880 KB Output is correct
5 Correct 565 ms 6024 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 427 ms 5884 KB Output is correct
2 Correct 552 ms 6008 KB Output is correct
3 Correct 439 ms 5880 KB Output is correct
4 Correct 664 ms 5880 KB Output is correct
5 Correct 590 ms 5956 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 439 ms 6628 KB Output is correct
2 Correct 483 ms 6672 KB Output is correct
3 Correct 473 ms 6720 KB Output is correct
4 Correct 763 ms 6648 KB Output is correct
5 Correct 664 ms 6648 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 495 ms 6648 KB Output is correct
2 Correct 629 ms 6648 KB Output is correct
3 Correct 503 ms 6648 KB Output is correct
4 Correct 766 ms 6788 KB Output is correct
5 Correct 672 ms 6660 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 538 ms 8208 KB Output is correct
2 Correct 603 ms 8208 KB Output is correct
3 Correct 598 ms 8152 KB Output is correct
4 Correct 952 ms 8204 KB Output is correct
5 Correct 837 ms 8212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 613 ms 8212 KB Output is correct
2 Correct 790 ms 8204 KB Output is correct
3 Correct 634 ms 8204 KB Output is correct
4 Correct 961 ms 8208 KB Output is correct
5 Correct 865 ms 8268 KB Output is correct