답안 #501773

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
501773 2022-01-04T14:38:58 Z chenwz Mobile (BOI12_mobile) C++11
100 / 100
361 ms 27392 KB
// BalticOI2012 - Mobile
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
#define _for(i, a, b) for (int i = (a); i < (int)(b); ++i)
const int NN = 1e6 + 4;
int X[NN], Y[NN];
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  int N, L;
  cin >> N >> L;
  // scanf("%d%d", &N, &L);
  for (int i = 0; i < N; i++)
    cin >> X[i] >> Y[i];  // scanf("%d%d", X + i, Y + i);
  double l = 1, r = 1.5e9;
  while (r - l > 1e-3) {
    double m = (l + r) / 2, curr = 0;
    for (int i = 0; i < N; i++) {
      double y = Y[i], delta = sqrt(m * m - y * y), a = X[i] - delta,
             b = X[i] + delta;
      if (a <= curr) curr = max(curr, b);
      if (curr >= L) break;
    }
    (curr >= L ? r : l) = m;
  }
  printf("%.4lf\n", l);
  return 0;
}
// 499716 Mobile (BOI12_mobile) C++11 100 / 100 405ms  27384KB
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 316 KB Output is correct
2 Correct 0 ms 332 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 332 KB Output is correct
2 Correct 1 ms 320 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 0 ms 332 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 332 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 1 ms 352 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 332 KB Output is correct
2 Correct 2 ms 412 KB Output is correct
3 Correct 2 ms 332 KB Output is correct
4 Correct 2 ms 332 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 332 KB Output is correct
2 Correct 1 ms 332 KB Output is correct
3 Correct 1 ms 324 KB Output is correct
4 Correct 2 ms 332 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 332 KB Output is correct
2 Correct 1 ms 328 KB Output is correct
3 Correct 2 ms 332 KB Output is correct
4 Correct 2 ms 336 KB Output is correct
5 Correct 1 ms 332 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 24 ms 1596 KB Output is correct
2 Correct 17 ms 1992 KB Output is correct
3 Correct 12 ms 1256 KB Output is correct
4 Correct 25 ms 1996 KB Output is correct
5 Correct 14 ms 1080 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 18 ms 1608 KB Output is correct
2 Correct 19 ms 1640 KB Output is correct
3 Correct 22 ms 1936 KB Output is correct
4 Correct 25 ms 2144 KB Output is correct
5 Correct 32 ms 2400 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 19 ms 1588 KB Output is correct
2 Correct 18 ms 2124 KB Output is correct
3 Correct 16 ms 1880 KB Output is correct
4 Correct 37 ms 3032 KB Output is correct
5 Correct 22 ms 1860 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 29 ms 2648 KB Output is correct
2 Correct 24 ms 2432 KB Output is correct
3 Correct 21 ms 2084 KB Output is correct
4 Correct 35 ms 3016 KB Output is correct
5 Correct 49 ms 2288 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 27 ms 2496 KB Output is correct
2 Correct 26 ms 2500 KB Output is correct
3 Correct 22 ms 2128 KB Output is correct
4 Correct 46 ms 2968 KB Output is correct
5 Correct 33 ms 2392 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 115 ms 8480 KB Output is correct
2 Correct 127 ms 11932 KB Output is correct
3 Correct 123 ms 11380 KB Output is correct
4 Correct 187 ms 13876 KB Output is correct
5 Correct 139 ms 11004 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 124 ms 12316 KB Output is correct
2 Correct 226 ms 10884 KB Output is correct
3 Correct 105 ms 9884 KB Output is correct
4 Correct 208 ms 13508 KB Output is correct
5 Correct 149 ms 11448 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 142 ms 10060 KB Output is correct
2 Correct 142 ms 14232 KB Output is correct
3 Correct 128 ms 13676 KB Output is correct
4 Correct 231 ms 16948 KB Output is correct
5 Correct 166 ms 12980 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 151 ms 14924 KB Output is correct
2 Correct 246 ms 12924 KB Output is correct
3 Correct 125 ms 11816 KB Output is correct
4 Correct 218 ms 16712 KB Output is correct
5 Correct 195 ms 13720 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 171 ms 11824 KB Output is correct
2 Correct 192 ms 16616 KB Output is correct
3 Correct 167 ms 15884 KB Output is correct
4 Correct 278 ms 19248 KB Output is correct
5 Correct 236 ms 14768 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 166 ms 17404 KB Output is correct
2 Correct 266 ms 14940 KB Output is correct
3 Correct 159 ms 14156 KB Output is correct
4 Correct 250 ms 19112 KB Output is correct
5 Correct 204 ms 15880 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 173 ms 13488 KB Output is correct
2 Correct 195 ms 19060 KB Output is correct
3 Correct 196 ms 18180 KB Output is correct
4 Correct 316 ms 22200 KB Output is correct
5 Correct 254 ms 17684 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 206 ms 19688 KB Output is correct
2 Correct 298 ms 17008 KB Output is correct
3 Correct 173 ms 15992 KB Output is correct
4 Correct 316 ms 22028 KB Output is correct
5 Correct 227 ms 18120 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 225 ms 16804 KB Output is correct
2 Correct 206 ms 23568 KB Output is correct
3 Correct 222 ms 22740 KB Output is correct
4 Correct 343 ms 27392 KB Output is correct
5 Correct 274 ms 21572 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 241 ms 24708 KB Output is correct
2 Correct 361 ms 21316 KB Output is correct
3 Correct 216 ms 20340 KB Output is correct
4 Correct 337 ms 27352 KB Output is correct
5 Correct 292 ms 22744 KB Output is correct