# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
305634 | ant101 | Mobile (BOI12_mobile) | C++14 | 912 ms | 51936 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <algorithm>
#include <cstring>
#include <iomanip>
#include <fstream>
#include <cmath>
#include <vector>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <map>
#include <stack>
#include <queue>
#include <assert.h>
#include <limits>
#include <cstdio>
#include <complex>
using namespace std;
#define rep(x,a) for(int x = 0; x < a; x++)
#define REP(x,a,b) for(int x = a; x < b; x++)
#define per(x,b) for(int x = b; x >= 0; x--)
#define all(container) (container).begin(), container.end()
#define rall(container) (container).rbegin(), container.rend()
#define sz(container) (int) (container).size()
#define pb push_back
#define eb emplace_back
#define fi first
#define sc second
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template<class T> bool smin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool smax(T &a, T b) { return a < b ? (a = b, true) : false; }
#ifdef LOCAL_DEFINE
#include "DEBUG.hpp"
#else
#define debug(...) 0
#endif
const double eps = 1e-3;
const double EPS = 1e-9;
bool eq(double a, double b) {
return abs(a-b) <= eps;
}
int main(void)
{
int n;
double last;
scanf("%d%lf", &n, &last);
vector<pair<double, double>> points(n);
rep(i,n) scanf("%lf%lf", &points[i].fi, &points[i].sc);
vector<pair<double, double>> poi;
rep(i,n) {
poi.emplace_back(points[i]);
++i;
while (i < n && eq(points[i].fi, poi.back().fi)) ++i;
--i;
}
auto Can = [&](double dist) {
double r = 0.0;
rep(i,n) {
double delta = sqrt(dist*dist-points[i].sc*points[i].sc);
double L = points[i].fi-delta, R = points[i].fi+delta;
if (L <= r) smax(r, R);
}
return (r >= last);
};
double l = 0.0, r = 1e10;
while (r-l > eps) {
double mid = (r+l)/2.0;
if (Can(mid)) r = mid;
else l = mid;
}
printf("%.6lf\n", l);
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... |