Submission #168818

# Submission time Handle Problem Language Result Execution time Memory
168818 2019-12-16T15:06:18 Z MohamedAhmed04 Mobile (BOI12_mobile) C++14
0 / 100
1000 ms 16188 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 = 1e12 ;
	double ans = high ;
	for(int i = 0 ; i < 37 ; ++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 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 504 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 71 ms 1528 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 71 ms 1656 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 72 ms 1884 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 102 ms 1912 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 103 ms 2028 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 407 ms 8240 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 551 ms 8364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 492 ms 9720 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 612 ms 9692 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 569 ms 11380 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 741 ms 11464 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 651 ms 12936 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 816 ms 12884 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 812 ms 16188 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1020 ms 16052 KB Time limit exceeded
2 Halted 0 ms 0 KB -