답안 #948288

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
948288 2024-03-18T03:26:27 Z Amaarsaa Mobile (BOI12_mobile) C++14
100 / 100
322 ms 35692 KB
#include<bits/stdc++.h>

using namespace std;
using ll = long long ;

ll n, l;
ll x[1000005], y[1000005];
bool Can(double R) {
	double D, x1, x2, mx = 0.0;
	for (int j = 1; j <= n; j ++) {
		D = R * R - y[j] * y[j];
		D = sqrt(D);
		x1 = x[j] - D;
		x2 = x[j] + D;
		if ( x1 <= mx) mx = max(mx,x2);
	}
	if ( mx < l) return false;
	return true;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	ll i;
	double lo , hi, mid;
	cin >> n >> l;
	
	for (i = 1; i <= n; i ++) {
		cin >> x[i] >> y[i];
	}
	lo = 0;
	hi = 1.5e9;
	
	while (hi - lo > 1e-3) {
 		mid = (lo + hi)/2;
		if (!Can(mid)) lo = mid;
		else hi = mid;
	}	
	cout << fixed << setprecision(4) << lo << "\n";
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Correct 1 ms 2396 KB Output is correct
3 Correct 1 ms 2396 KB Output is correct
4 Correct 1 ms 2396 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Correct 1 ms 2396 KB Output is correct
3 Correct 1 ms 2396 KB Output is correct
4 Correct 1 ms 2396 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 2548 KB Output is correct
2 Correct 1 ms 2524 KB Output is correct
3 Correct 1 ms 2396 KB Output is correct
4 Correct 1 ms 2396 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 2392 KB Output is correct
2 Correct 2 ms 2396 KB Output is correct
3 Correct 2 ms 2396 KB Output is correct
4 Correct 2 ms 2396 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 2396 KB Output is correct
2 Correct 2 ms 2396 KB Output is correct
3 Correct 2 ms 2392 KB Output is correct
4 Correct 2 ms 2396 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 2556 KB Output is correct
2 Correct 2 ms 2396 KB Output is correct
3 Correct 2 ms 2396 KB Output is correct
4 Correct 2 ms 2392 KB Output is correct
5 Correct 2 ms 2396 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 24 ms 6748 KB Output is correct
2 Correct 19 ms 7772 KB Output is correct
3 Correct 13 ms 5220 KB Output is correct
4 Correct 29 ms 7784 KB Output is correct
5 Correct 13 ms 4968 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 21 ms 6760 KB Output is correct
2 Correct 22 ms 5480 KB Output is correct
3 Correct 24 ms 7832 KB Output is correct
4 Correct 24 ms 7784 KB Output is correct
5 Correct 28 ms 8296 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 22 ms 6760 KB Output is correct
2 Correct 20 ms 6764 KB Output is correct
3 Correct 21 ms 7516 KB Output is correct
4 Correct 35 ms 8956 KB Output is correct
5 Correct 24 ms 7516 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 25 ms 6744 KB Output is correct
2 Correct 25 ms 8028 KB Output is correct
3 Correct 23 ms 7768 KB Output is correct
4 Correct 42 ms 8736 KB Output is correct
5 Correct 32 ms 8052 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 24 ms 6748 KB Output is correct
2 Correct 24 ms 6800 KB Output is correct
3 Correct 24 ms 7764 KB Output is correct
4 Correct 37 ms 8540 KB Output is correct
5 Correct 28 ms 7928 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 114 ms 10880 KB Output is correct
2 Correct 121 ms 10836 KB Output is correct
3 Correct 117 ms 10628 KB Output is correct
4 Correct 156 ms 10876 KB Output is correct
5 Correct 164 ms 17548 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 122 ms 10864 KB Output is correct
2 Correct 175 ms 10836 KB Output is correct
3 Correct 125 ms 16504 KB Output is correct
4 Correct 157 ms 20224 KB Output is correct
5 Correct 147 ms 18044 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 124 ms 15192 KB Output is correct
2 Correct 145 ms 14984 KB Output is correct
3 Correct 144 ms 23660 KB Output is correct
4 Correct 194 ms 27116 KB Output is correct
5 Correct 198 ms 22864 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 145 ms 14968 KB Output is correct
2 Correct 206 ms 14984 KB Output is correct
3 Correct 144 ms 21588 KB Output is correct
4 Correct 196 ms 26620 KB Output is correct
5 Correct 173 ms 23548 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 148 ms 14932 KB Output is correct
2 Correct 170 ms 14980 KB Output is correct
3 Correct 166 ms 24912 KB Output is correct
4 Correct 241 ms 28536 KB Output is correct
5 Correct 194 ms 23892 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 184 ms 14980 KB Output is correct
2 Correct 238 ms 14928 KB Output is correct
3 Correct 166 ms 23124 KB Output is correct
4 Correct 224 ms 28636 KB Output is correct
5 Correct 203 ms 25132 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 165 ms 14980 KB Output is correct
2 Correct 191 ms 14932 KB Output is correct
3 Correct 194 ms 26616 KB Output is correct
4 Correct 258 ms 30712 KB Output is correct
5 Correct 229 ms 25972 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 195 ms 14988 KB Output is correct
2 Correct 263 ms 14928 KB Output is correct
3 Correct 189 ms 24516 KB Output is correct
4 Correct 256 ms 30476 KB Output is correct
5 Correct 236 ms 26584 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 217 ms 16012 KB Output is correct
2 Correct 239 ms 15996 KB Output is correct
3 Correct 246 ms 30664 KB Output is correct
4 Correct 321 ms 35692 KB Output is correct
5 Correct 292 ms 29520 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 269 ms 16092 KB Output is correct
2 Correct 321 ms 15952 KB Output is correct
3 Correct 238 ms 28388 KB Output is correct
4 Correct 322 ms 35444 KB Output is correct
5 Correct 300 ms 30852 KB Output is correct