답안 #168836

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
168836 2019-12-16T16:19:37 Z MohamedAhmed04 Mobile (BOI12_mobile) C++14
100 / 100
980 ms 23160 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) ;
	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 < 41 ; ++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]) ;
   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 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 380 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 3 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 376 KB Output is correct
2 Correct 3 ms 380 KB Output is correct
3 Correct 3 ms 376 KB Output is correct
4 Correct 3 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 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
# 결과 실행 시간 메모리 Grader output
1 Correct 6 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
# 결과 실행 시간 메모리 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 504 KB Output is correct
5 Correct 5 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 58 ms 1020 KB Output is correct
2 Correct 49 ms 888 KB Output is correct
3 Correct 36 ms 888 KB Output is correct
4 Correct 68 ms 888 KB Output is correct
5 Correct 36 ms 760 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 59 ms 888 KB Output is correct
2 Correct 58 ms 980 KB Output is correct
3 Correct 72 ms 1144 KB Output is correct
4 Correct 71 ms 1028 KB Output is correct
5 Correct 82 ms 1016 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 50 ms 1016 KB Output is correct
2 Correct 52 ms 992 KB Output is correct
3 Correct 57 ms 1016 KB Output is correct
4 Correct 100 ms 1188 KB Output is correct
5 Correct 70 ms 1144 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 65 ms 1188 KB Output is correct
2 Correct 63 ms 1144 KB Output is correct
3 Correct 64 ms 1180 KB Output is correct
4 Correct 100 ms 1144 KB Output is correct
5 Correct 84 ms 1144 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 64 ms 1144 KB Output is correct
2 Correct 62 ms 1144 KB Output is correct
3 Correct 63 ms 1144 KB Output is correct
4 Correct 100 ms 1144 KB Output is correct
5 Correct 84 ms 1144 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 278 ms 4344 KB Output is correct
2 Correct 305 ms 4324 KB Output is correct
3 Correct 302 ms 4332 KB Output is correct
4 Correct 485 ms 4348 KB Output is correct
5 Correct 421 ms 4348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 307 ms 4272 KB Output is correct
2 Correct 406 ms 4344 KB Output is correct
3 Correct 315 ms 4344 KB Output is correct
4 Correct 492 ms 4316 KB Output is correct
5 Correct 441 ms 4312 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 341 ms 5044 KB Output is correct
2 Correct 363 ms 5140 KB Output is correct
3 Correct 360 ms 5204 KB Output is correct
4 Correct 592 ms 5128 KB Output is correct
5 Correct 497 ms 4984 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 367 ms 5088 KB Output is correct
2 Correct 490 ms 5124 KB Output is correct
3 Correct 379 ms 5216 KB Output is correct
4 Correct 590 ms 5144 KB Output is correct
5 Correct 517 ms 5112 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 387 ms 5880 KB Output is correct
2 Correct 427 ms 5892 KB Output is correct
3 Correct 421 ms 5912 KB Output is correct
4 Correct 684 ms 5808 KB Output is correct
5 Correct 574 ms 5964 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 427 ms 5880 KB Output is correct
2 Correct 565 ms 5908 KB Output is correct
3 Correct 443 ms 5936 KB Output is correct
4 Correct 678 ms 5880 KB Output is correct
5 Correct 602 ms 5988 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 446 ms 6592 KB Output is correct
2 Correct 487 ms 6648 KB Output is correct
3 Correct 483 ms 6776 KB Output is correct
4 Correct 788 ms 6648 KB Output is correct
5 Correct 676 ms 6692 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 489 ms 6716 KB Output is correct
2 Correct 644 ms 6648 KB Output is correct
3 Correct 503 ms 6776 KB Output is correct
4 Correct 781 ms 6816 KB Output is correct
5 Correct 694 ms 6652 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 560 ms 8204 KB Output is correct
2 Correct 608 ms 8248 KB Output is correct
3 Correct 602 ms 8148 KB Output is correct
4 Correct 980 ms 8208 KB Output is correct
5 Correct 843 ms 21804 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 613 ms 8272 KB Output is correct
2 Correct 805 ms 8212 KB Output is correct
3 Correct 636 ms 8172 KB Output is correct
4 Correct 980 ms 8208 KB Output is correct
5 Correct 869 ms 23160 KB Output is correct