# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
930445 | sleepntsheep | Mobile (BOI12_mobile) | C++17 | 1102 ms | 16588 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <stdio.h>
#define N 1000000
int n, L, x[N], y[N];
int ok(long double m)
{
m *= m;
long double li = -1e9, ri = 1e9;
for (int i = 0; i < n; ++i)
{
long double a = x[i];
long double lbnd, rbnd;
long double l = -1e9, r = a;
for (int iter = 100; iter--;)
{
long double mm = (l+r)/2;
if (mm*mm - 2*mm*x[i] <= m - x[i] * x[i] - y[i] * y[i])
r = mm, lbnd = mm;
else l = mm;
}
l = a, r = 1e9;
for (int iter = 100; iter--;)
{
long double mm = (l+r)/2;
if (mm*mm - 2*mm*x[i] <= m - x[i] * x[i] - y[i] * y[i])
l = mm, rbnd = mm;
else r = mm;
}
if (lbnd > li) li = lbnd;
if (ri > rbnd) ri = rbnd;
}
if (li > ri) return 0;
return 1;
}
int main()
{
scanf("%d%d", &n, &L);
for (int i = 0; i < n; ++i) scanf("%d%d", x+i, y+i);
long double l = 0, r = 1e18;
for (int iter = 400; iter--;)
{
long double m = (l+r)/2;
if (ok(m)) r = m;
else l = m;
}
printf("%.6Lf", r);
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |