Submission #168825

# Submission time Handle Problem Language Result Execution time Memory
168825 2019-12-16T15:41:41 Z MohamedAhmed04 Mobile (BOI12_mobile) C++14
90 / 100
1000 ms 27536 KB
#include <bits/stdc++.h>
 
using namespace std ;
 
const int MAX = 1e6 + 10 ;
int x[MAX] , y[MAX] ;
int n ;
double l;
 
bool check(double radius)
{
	double now = 0.00 ;
	for(int i = 0 ; i < n ; ++i)
	{
		double a = sqrt(radius * radius - ((-y[i] * 1ll) * (-y[i] * 1ll))) + x[i] * 1ll ;
		double 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 = 1e10 ;
	double ans = high ;
	for(int i = 0 ; i < 50 ; ++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 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 4 ms 376 KB Output is correct
3 Correct 4 ms 376 KB Output is correct
4 Correct 3 ms 248 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 508 KB Output is correct
2 Correct 5 ms 504 KB Output is correct
3 Correct 5 ms 504 KB Output is correct
4 Correct 7 ms 504 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 504 KB Output is correct
4 Correct 7 ms 504 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 504 KB Output is correct
2 Correct 5 ms 504 KB Output is correct
3 Correct 5 ms 376 KB Output is correct
4 Correct 7 ms 504 KB Output is correct
5 Correct 6 ms 504 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 66 ms 1656 KB Output is correct
2 Correct 53 ms 2040 KB Output is correct
3 Correct 40 ms 1344 KB Output is correct
4 Correct 76 ms 2040 KB Output is correct
5 Correct 42 ms 1148 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 70 ms 1756 KB Output is correct
2 Correct 65 ms 1656 KB Output is correct
3 Correct 77 ms 2040 KB Output is correct
4 Correct 80 ms 2168 KB Output is correct
5 Correct 90 ms 2520 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 55 ms 1656 KB Output is correct
2 Correct 58 ms 2268 KB Output is correct
3 Correct 62 ms 1912 KB Output is correct
4 Correct 110 ms 3064 KB Output is correct
5 Correct 81 ms 2040 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 70 ms 2732 KB Output is correct
2 Correct 69 ms 2640 KB Output is correct
3 Correct 72 ms 2168 KB Output is correct
4 Correct 110 ms 3156 KB Output is correct
5 Correct 94 ms 2424 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 70 ms 2680 KB Output is correct
2 Correct 69 ms 2592 KB Output is correct
3 Correct 71 ms 2168 KB Output is correct
4 Correct 111 ms 3124 KB Output is correct
5 Correct 96 ms 2424 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 316 ms 8696 KB Output is correct
2 Correct 344 ms 12000 KB Output is correct
3 Correct 340 ms 11476 KB Output is correct
4 Correct 537 ms 12280 KB Output is correct
5 Correct 478 ms 11132 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 351 ms 12596 KB Output is correct
2 Correct 469 ms 10956 KB Output is correct
3 Correct 362 ms 9976 KB Output is correct
4 Correct 534 ms 13048 KB Output is correct
5 Correct 491 ms 11636 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 375 ms 10360 KB Output is correct
2 Correct 423 ms 13724 KB Output is correct
3 Correct 408 ms 13736 KB Output is correct
4 Correct 653 ms 11064 KB Output is correct
5 Correct 569 ms 13104 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 419 ms 14968 KB Output is correct
2 Correct 556 ms 12920 KB Output is correct
3 Correct 434 ms 11896 KB Output is correct
4 Correct 652 ms 11216 KB Output is correct
5 Correct 584 ms 13800 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 441 ms 11984 KB Output is correct
2 Correct 491 ms 12352 KB Output is correct
3 Correct 510 ms 12664 KB Output is correct
4 Correct 760 ms 11900 KB Output is correct
5 Correct 658 ms 15072 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 487 ms 15712 KB Output is correct
2 Correct 652 ms 14432 KB Output is correct
3 Correct 510 ms 14328 KB Output is correct
4 Correct 758 ms 11772 KB Output is correct
5 Correct 696 ms 16120 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 499 ms 13648 KB Output is correct
2 Correct 555 ms 12804 KB Output is correct
3 Correct 558 ms 12964 KB Output is correct
4 Correct 893 ms 12456 KB Output is correct
5 Correct 853 ms 17908 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 561 ms 14712 KB Output is correct
2 Correct 740 ms 13432 KB Output is correct
3 Correct 576 ms 14680 KB Output is correct
4 Correct 868 ms 12920 KB Output is correct
5 Correct 773 ms 18316 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 621 ms 16772 KB Output is correct
2 Correct 684 ms 13944 KB Output is correct
3 Correct 689 ms 22904 KB Output is correct
4 Execution timed out 1079 ms 27384 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 704 ms 15744 KB Output is correct
2 Correct 923 ms 21368 KB Output is correct
3 Correct 729 ms 20636 KB Output is correct
4 Execution timed out 1076 ms 27536 KB Time limit exceeded
5 Halted 0 ms 0 KB -