Submission #168820

# Submission time Handle Problem Language Result Execution time Memory
168820 2019-12-16T15:09:41 Z MohamedAhmed04 Mobile (BOI12_mobile) C++14
70 / 100
1000 ms 16020 KB
#include <bits/stdc++.h>

using namespace std ;

const int MAX = 1e6 + 10 ;
double 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]) * (-y[i]))) + x[i] ;
		double b = -sqrt(radius * radius - ((-y[i]) * (-y[i]))) + x[i] ;
		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 5 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 4 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 504 KB Output is correct
2 Correct 7 ms 376 KB Output is correct
3 Correct 7 ms 476 KB Output is correct
4 Correct 8 ms 504 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 480 KB Output is correct
2 Correct 8 ms 504 KB Output is correct
3 Correct 7 ms 504 KB Output is correct
4 Correct 9 ms 504 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 7 ms 376 KB Output is correct
2 Correct 7 ms 504 KB Output is correct
3 Correct 7 ms 376 KB Output is correct
4 Correct 9 ms 504 KB Output is correct
5 Correct 7 ms 504 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 89 ms 1520 KB Output is correct
2 Correct 86 ms 1500 KB Output is correct
3 Correct 58 ms 1144 KB Output is correct
4 Correct 105 ms 1528 KB Output is correct
5 Correct 56 ms 1144 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 92 ms 1616 KB Output is correct
2 Correct 87 ms 1400 KB Output is correct
3 Correct 104 ms 1656 KB Output is correct
4 Correct 112 ms 1656 KB Output is correct
5 Correct 125 ms 1656 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 84 ms 1736 KB Output is correct
2 Correct 92 ms 1688 KB Output is correct
3 Correct 90 ms 1724 KB Output is correct
4 Correct 151 ms 2040 KB Output is correct
5 Correct 108 ms 1784 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 113 ms 1888 KB Output is correct
2 Correct 114 ms 2040 KB Output is correct
3 Correct 104 ms 1952 KB Output is correct
4 Correct 152 ms 1972 KB Output is correct
5 Correct 127 ms 1912 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 111 ms 1912 KB Output is correct
2 Correct 111 ms 1912 KB Output is correct
3 Correct 105 ms 2052 KB Output is correct
4 Correct 152 ms 1968 KB Output is correct
5 Correct 128 ms 1912 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 464 ms 8312 KB Output is correct
2 Correct 558 ms 8216 KB Output is correct
3 Correct 546 ms 8184 KB Output is correct
4 Correct 749 ms 8384 KB Output is correct
5 Correct 649 ms 8312 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 564 ms 8316 KB Output is correct
2 Correct 638 ms 8124 KB Output is correct
3 Correct 524 ms 8280 KB Output is correct
4 Correct 742 ms 8160 KB Output is correct
5 Correct 662 ms 8184 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 566 ms 9788 KB Output is correct
2 Correct 677 ms 9792 KB Output is correct
3 Correct 656 ms 9924 KB Output is correct
4 Correct 916 ms 9836 KB Output is correct
5 Correct 781 ms 9968 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 685 ms 9884 KB Output is correct
2 Correct 779 ms 9860 KB Output is correct
3 Correct 645 ms 9868 KB Output is correct
4 Correct 911 ms 9800 KB Output is correct
5 Correct 794 ms 9848 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 648 ms 11452 KB Output is correct
2 Correct 787 ms 11384 KB Output is correct
3 Correct 763 ms 11336 KB Output is correct
4 Execution timed out 1060 ms 11384 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 793 ms 11384 KB Output is correct
2 Correct 893 ms 11384 KB Output is correct
3 Correct 752 ms 11484 KB Output is correct
4 Execution timed out 1047 ms 11384 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 745 ms 12920 KB Output is correct
2 Correct 903 ms 13048 KB Output is correct
3 Correct 873 ms 12920 KB Output is correct
4 Execution timed out 1077 ms 12896 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 905 ms 13060 KB Output is correct
2 Execution timed out 1025 ms 12988 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 940 ms 15996 KB Output is correct
2 Execution timed out 1086 ms 15992 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1067 ms 16020 KB Time limit exceeded
2 Halted 0 ms 0 KB -