Submission #168833

# Submission time Handle Problem Language Result Execution time Memory
168833 2019-12-16T16:15:08 Z MohamedAhmed04 Mobile (BOI12_mobile) C++14
25 / 100
1000 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 = sqrtl(radius * radius - ((-y[i] * 1ll) * (-y[i] * 1ll))) + x[i] * 1ll ;
		b = -sqrtl(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) ;
	scanf("%d %d" , &n , &l) ;
	for(int i = 0 ; i < n ; ++i)
		scanf("%d %d" , &x[i] , &y[i]) ;
	double low = 0.000 , high = 1e9 ;
	double ans = high ;
	for(int i = 0 ; i < 45 ; ++i)
	{
		double mid = (low + high) / 2.00 ;
		if(check(mid))
			ans = mid , high = mid ;
		else
			low = mid ;
	}
	return printf("%.6lf\n" , ans) , 0 ;
}

Compilation message

mobile.cpp: In function 'int main()':
mobile.cpp:29:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d" , &n , &l) ;
  ~~~~~^~~~~~~~~~~~~~~~~~~
mobile.cpp:31:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d %d" , &x[i] , &y[i]) ;
   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 248 KB Output is correct
3 Correct 2 ms 380 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 5 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 56 ms 504 KB Output is correct
2 Correct 9 ms 376 KB Output is correct
3 Correct 41 ms 376 KB Output is correct
4 Correct 3 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 115 ms 440 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 40 ms 436 KB Output is correct
4 Correct 153 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 121 ms 440 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 38 ms 380 KB Output is correct
4 Correct 156 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 15 ms 376 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 39 ms 376 KB Output is correct
4 Correct 163 ms 376 KB Output is correct
5 Correct 104 ms 436 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1061 ms 888 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1075 ms 888 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 57 ms 1120 KB Output is correct
2 Correct 56 ms 1004 KB Output is correct
3 Correct 724 ms 1068 KB Output is correct
4 Execution timed out 1078 ms 1144 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 68 ms 1180 KB Output is correct
2 Correct 68 ms 1180 KB Output is correct
3 Correct 807 ms 1184 KB Output is correct
4 Execution timed out 1073 ms 1148 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 71 ms 1188 KB Output is correct
2 Correct 68 ms 1212 KB Output is correct
3 Correct 819 ms 1184 KB Output is correct
4 Execution timed out 1072 ms 1144 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 315 ms 4216 KB Output is correct
2 Correct 332 ms 4472 KB Output is correct
3 Correct 334 ms 4364 KB Output is correct
4 Execution timed out 1077 ms 4344 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 330 ms 4312 KB Output is correct
2 Execution timed out 1072 ms 4216 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 377 ms 4984 KB Output is correct
2 Correct 404 ms 5112 KB Output is correct
3 Correct 402 ms 5116 KB Output is correct
4 Execution timed out 1074 ms 5112 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 396 ms 5156 KB Output is correct
2 Execution timed out 1079 ms 5112 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 440 ms 5880 KB Output is correct
2 Correct 468 ms 5964 KB Output is correct
3 Correct 465 ms 5880 KB Output is correct
4 Execution timed out 1089 ms 5880 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 464 ms 5752 KB Output is correct
2 Execution timed out 1079 ms 5776 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 503 ms 6648 KB Output is correct
2 Correct 557 ms 6748 KB Output is correct
3 Correct 534 ms 6648 KB Output is correct
4 Execution timed out 1061 ms 6776 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 529 ms 6620 KB Output is correct
2 Execution timed out 1085 ms 6604 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 628 ms 8184 KB Output is correct
2 Correct 669 ms 8272 KB Output is correct
3 Correct 693 ms 8188 KB Output is correct
4 Execution timed out 1074 ms 8312 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 655 ms 8196 KB Output is correct
2 Execution timed out 1083 ms 8248 KB Time limit exceeded
3 Halted 0 ms 0 KB -