QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#582076 | #142. 平面最近点对 | xorzj | 0 | 2ms | 4172kb | C++17 | 21.5kb | 2024-09-22 15:14:54 | 2024-09-22 15:14:56 |
answer
#include <bits/stdc++.h>
#define rep(a, b, c) for (int a = b; a <= c; a++)
#define ALL(x) (x).begin(), (x).end()
#define IOS cin.tie(0)->sync_with_stdio(false)
#ifdef LOCAL
#include "debug.h"
#else
#define deb(...) 42
#endif
#define OPENSTACK
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
const int MAXN = 2e5 + 5;
const int INF = 0x3f3f3f3f;
typedef double db;
constexpr db inf = 1e20;
constexpr db eps = 1e-8;
const db pi = acos(-1);
constexpr int sgn(db x) { return x < -eps ? -1 : x > eps; }
constexpr int cmp(db x, db y) { return sgn(x - y); }
struct Point {
db x, y;
constexpr Point(db _x = 0, db _y = 0) : x(_x), y(_y) {}
constexpr Point operator+() const noexcept { return *this; }
constexpr Point operator-() const noexcept { return Point(-x, -y); }
constexpr Point operator+(const Point& p) const
{
return Point(x + p.x, y + p.y);
}
constexpr Point operator-(const Point& p) const
{
return Point(x - p.x, y - p.y);
}
constexpr Point operator*(const db& k) { return Point(x * k, y * k); }
constexpr Point operator/(const db& k) { return Point(x / k, y / k); }
constexpr Point& operator+=(const Point& p)
{
return x += p.x, y += p.y, *this;
}
constexpr Point& operator-=(const Point& p)
{
return x -= p.x, y -= p.y, *this;
}
constexpr Point& operator*=(const db& k) { return x *= k, y *= k, *this; }
constexpr Point& operator/=(const db& k) { return x /= k, y /= k, *this; }
constexpr bool operator==(const Point& r) const noexcept
{
return cmp(x, r.x) == 0 and cmp(y, r.y) == 0;
}
constexpr bool operator<(const Point& r) const noexcept
{
return sgn(x - r.x) == 0 ? sgn(y - r.y) < 0 : x < r.x;
}
friend istream& operator>>(istream& is, Point& p) { return is >> p.x >> p.y; }
friend ostream& operator<<(ostream& os, Point p)
{
return os << "(" << p.x << ", " << p.y << ")";
}
constexpr db dot(const Point& r) const { return x * r.x + y * r.y; }
constexpr db cross(const Point& r) const { return x * r.y - y * r.x; }
constexpr int quad() const
{
return sgn(y) > 0 || (sgn(y) == 0 && sgn(x) > 0) ? 1 : -1;
}
constexpr bool arg_cmp(const Point& r) const
{
int L = (*this).quad(), R = r.quad();
if (L != R) return L < R;
db X = x * r.y, Y = r.x * y;
if (X != Y) return X > Y;
return x < r.x;
}
};
db dot(Point a, Point b) { return a.x * b.x + a.y * b.y; }
db cross(Point a, Point b) { return a.x * b.y - a.y * b.x; }
db square(Point p) { return dot(p, p); }
db len(Point p) { return sqrt(db(square(p))); }
Point unit(Point p) { return p / len(p); }
db arg(Point p) { return atan2(p.y, p.x); }
Point polar(db r, db theta) { return Point(cos(theta) * r, sin(theta) * r); }
Point rotleft(Point p) { return Point(-p.y, p.x); }
Point rotright(Point p) { return Point(p.y, -p.x); }
Point rotate(Point p, Point r, db angle)
{
Point v = p - r;
db c = cos(angle), s = sin(angle);
return Point(p.x + v.x * c - v.y * s, p.y + v.x * s + v.y * c);
}
// 1 : left, 0 : same, -1 : right
int toleft(Point a, Point b, Point c) { return sgn(cross(b - a, c - a)); }
int toleft(Point a, Point b) { return sgn(cross(a, b)); }
//(0,0) in negative plane
int quad(Point p)
{
return sgn(p.y) > 0 || (sgn(p.y) == 0 && sgn(p.x) > 0) ? 1 : -1;
}
bool arg_cmp(const Point& l, const Point& r) { return l.arg_cmp(r); }
db distance(const Point& a, const Point& b) { return len(a - b); }
struct Line {
Point a, b;
Line() = default;
Line(Point a, Point b) : a(a), b(b) {}
Line(Point p, db angle)
{
a = p;
if (cmp(angle, pi / 2) == 0)
b = (a + Point(0, 1));
else
b = (a + Point(1, tan(angle)));
}
// ax + by + c = 0
Line(db A, db B, db C)
{
if (sgn(A) == 0)
a = Point(0, -C / B), b = Point(1, -C / B);
else if (sgn(B) == 0)
a = Point(-C / A, 0), b = Point(-C / A, 1);
else
a = Point(0, -C / B), b = Point(-C / A, 0);
}
};
struct Segment : Line {
Segment() = default;
Segment(Point a, Point b) : Line(a, b) {}
};
db len(const Line& l) { return len(l.b - l.a); }
int toleft(Point p, Line l) { return sgn(cross(l.b - l.a, p - l.a)); }
bool parallel(Line l1, Line l2)
{
return sgn(cross(l1.b - l1.a, l2.b - l2.a)) == 0;
}
bool orthogonal(const Line& l1, const Line& l2)
{
return sgn(dot(l1.a - l1.b, l2.a - l2.b)) == 0;
}
#define crossOp(a, b) sgn(cross(a, b))
#define dotOp(a, b) sgn(dot(a, b))
// 两直线弧度
db rad(const Line& l1, const Line& l2)
{
return atan2(fabs(cross(l1.b - l1.a, l2.b - l2.a)),
dot(l1.b - l1.a, l2.b - l2.a));
}
// 返回直线倾斜角 0<=angle<π
db angle(const Line& l)
{
db k = atan2(l.b.y - l.a.y, l.b.x - l.a.x);
if (sgn(k) < 0) k += pi;
if (sgn(k - pi) == 0) k -= pi;
return k;
}
db distancePL(const Point& p, const Line& l)
{
return fabs(cross(l.b - l.a, p - l.a)) / len(l);
}
db distancePS(const Point& p, const Segment& l)
{
if (sgn(dot(p - l.a, l.b - l.a)) < 0) return distance(p, l.a);
if (sgn(dot(p - l.b, l.a - l.b)) < 0) return distance(p, l.b);
return distancePL(p, l);
}
int pointonsegment(Point a, Point b, Point c)
{
b = b - a, c = c - a;
if (cross(b, c) > 0) return +1; // "COUNTER_CLOCKWISE"
if (cross(b, c) < 0) return -1; // "CLOCKWISE"
if (dot(b, c) < 0) return +2; // "ONLINE_BACK"
if (square(b) < square(c)) return -2; // "ONLINE_FRONT"
return 0; // "ON_SEGMENT"
}
bool intersect(const Point& p, const Line& l)
{
return abs(pointonsegment(l.a, l.b, p)) != 1;
}
bool intersect(const Point& p, const Segment& s)
{
return pointonsegment(s.a, s.b, p) == 0;
}
bool intersect(const Line& l, const Line& m) { return !parallel(l, m); }
bool intersect(const Line& l, const Segment& s)
{
return crossOp(l.b - l.a, s.a - l.a) * crossOp(l.b - l.a, s.b - l.a) <= 0;
}
bool intersect(const Segment& s, const Segment& t)
{
return pointonsegment(s.a, s.b, t.a) * pointonsegment(s.a, s.b, t.b) <= 0 &&
pointonsegment(t.a, t.b, s.a) * pointonsegment(t.a, t.b, s.b) <= 0;
}
db distanceSS(const Segment& l, const Segment& m)
{
if (intersect(l, m)) return 0.0;
return min({ distancePS(l.a, m), distancePS(l.b, m), distancePS(m.a, l),
distancePS(m.b, l) });
}
// 2 规范相交 1 非规范相交 0 不相交
int crossSS(Segment l, Segment m)
{
int d1 = toleft(m.a, l);
int d2 = toleft(m.b, l);
int d3 = toleft(l.a, m);
int d4 = toleft(l.b, m);
if ((d1 ^ d2) == -2 && (d3 ^ d4) == -2) return 2;
return (d1 == 0 && intersect(m.a, l)) || (d2 == 0 && intersect(m.b, l)) ||
(d3 == 0 && intersect(l.a, m)) || (d4 == 0 && intersect(l.b, m));
}
// 2 规范相交 1 非规范相交 0 不相交
int crossLS(Line l, Segment m)
{
int d1 = toleft(m.a, l);
int d2 = toleft(m.b, l);
if ((d1 ^ d2) == -2) return 2;
return (d1 == 0 || d2 == 0);
}
// 0 平行 1 重合 2 相交
int crossLL(Line l, Line m)
{
if (parallel(l, m)) return intersect(l.a, m);
return 2;
}
Point crosspointLL(const Line& l, const Line& m)
{
db A = cross(l.b - l.a, m.b - m.a);
db B = cross(l.b - l.a, l.b - m.a);
if (sgn(A) == 0 and sgn(B) == 0) return m.a;
return m.a + (m.b - m.a) * (B / A);
}
// 点到直线投影点
Point projection(const Point& p, const Line& l)
{
db t = dot(p - l.a, l.a - l.b) / square(l.a - l.b);
return l.a + (l.a - l.b) * t;
}
// 直线对称点
Point symmetrypoint(const Point& p, const Line& l)
{
Point q = projection(p, l);
return Point(2 * q.x - p.x, 2 * q.y - p.y);
}
using P = Point;
using Points = vector<P>;
using Polygon = Points;
// 周长
db perimeter(const Polygon& p)
{
db res = 0;
int n = p.size();
for (int i = 0; i < n; i++) res += len(p[i] - p[(i + 1) % n]);
return res;
}
// 面积两倍
db area2(const Polygon& p)
{
db res = 0;
int n = p.size();
for (int i = 0; i < n; i++) res += cross(p[i], p[(i + 1) % n]);
return res;
}
// 凸性判定 逆时针给出点
bool is_convex(const Polygon& p)
{
int n = (int) p.size();
for (int i = 0; i < n; i++) {
if (pointonsegment(p[(i + n - 1) % n], p[i], p[(i + 1) % n]) == -1)
return false;
}
return true;
}
enum { OUT, ON, IN };
// 2 contains 1 on segment 0 out
int pointInPolygon(const Point& a, const Polygon& p)
{
int n = p.size();
for (int i = 0; i < n; i++) {
if (intersect(a, Segment(p[i], p[(i + 1) % n]))) return ON;
}
int t = 0;
for (int i = 0; i < n; i++) {
auto u = p[i];
auto v = p[(i + 1) % n];
if (cmp(u.x, a.x) == -1 && cmp(v.x, a.x) >= 0 &&
toleft(a, Line(v, u)) > 0) {
t ^= 1;
}
if (cmp(u.x, a.x) >= 0 && cmp(v.x, a.x) == -1 &&
toleft(a, Line(u, v)) > 0) {
t ^= 1;
}
}
return t == 1 ? IN : OUT;
}
// 凸多边形log求包含点问题
int pointInconvexPolygonlog(const Point& p, const Polygon& Q)
{
int N = (int) Q.size();
Point g = (Q[0] + Q[N / 3] + Q[N * 2 / 3]) / 3.0;
if (g == p) return IN;
Point gp = p - g;
int l = 0, r = N;
while (r - l > 1) {
int mid = (l + r) / 2;
Point gl = Q[l] - g;
Point gm = Q[mid] - g;
if (cross(gl, gm) > 0) {
if (cross(gl, gp) >= 0 && cross(gm, gp) <= 0)
r = mid;
else
l = mid;
}
else {
if (cross(gl, gp) <= 0 && cross(gm, gp) >= 0)
l = mid;
else
r = mid;
}
}
r %= N;
db v = cross(Q[l] - p, Q[r] - p);
return sgn(v) == 0 ? ON : sgn(v) == -1 ? OUT : IN;
}
bool segmentInPolygon(const Segment& s, const Polygon& p)
{
auto [a, b] = s;
if (pointInPolygon(a, p) == 0 || pointInPolygon(b, p) == 0) return false;
int n = p.size();
Polygon q;
for (int i = 0; i < n; i++) {
auto l = Segment(p[i], p[(i + 1) % n]);
if (crossSS(s, l) == 2) return false;
if (intersect(a, l))
q.push_back(a);
else if (intersect(b, l))
q.push_back(b);
else if (intersect(p[i], l))
q.push_back(p[i]);
}
sort(q.begin(), q.end());
for (int i = 0; i + 1 < q.size(); i++) {
if (pointInPolygon((q[i] + q[i + 1]) / 2, p) == 0) return false;
}
return true;
}
bool intersect(const Polygon& ps, const Polygon& qs)
{
int pl = ps.size(), ql = qs.size(), i = 0, j = 0;
while ((i < pl or j < ql) and (i < 2 * pl) and (j < 2 * ql)) {
auto ps0 = ps[(i + pl - 1) % pl], ps1 = ps[i % pl];
auto qs0 = qs[(j + ql - 1) % ql], qs1 = qs[j % ql];
if (intersect(Segment(ps0, ps1), Segment(qs0, qs1))) return true;
Point a = ps1 - ps0;
Point b = qs1 - qs0;
db v = cross(a, b);
db va = cross(qs1 - qs0, ps1 - qs0);
db vb = cross(ps1 - ps0, qs1 - ps0);
if (!v and va < 0 and vb < 0) return false;
if (!v and !va and !vb) {
i += 1;
}
else if (v >= 0) {
if (vb > 0)
i += 1;
else
j += 1;
}
else {
if (va > 0)
j += 1;
else
i += 1;
}
}
return false;
}
// 凸包
Polygon getHull(Polygon p)
{
Polygon h, l;
sort(p.begin(), p.end());
p.erase(unique(p.begin(), p.end()), p.end());
if (p.size() <= 1) return p;
for (auto a : p) {
//<= >= 弹出共线点 < >不弹出共线点
while (h.size() > 1 && cross(a - h.back(), a - h[h.size() - 2]) <= 0)
h.pop_back();
while (l.size() > 1 && cross(a - l.back(), a - l[l.size() - 2]) >= 0)
l.pop_back();
l.push_back(a);
h.push_back(a);
}
l.pop_back();
reverse(h.begin(), h.end());
h.pop_back();
l.insert(l.end(), h.begin(), h.end());
return l;
}
// 平面割 返回l左侧的多边形,凸多边形
Polygon convex_cut(const Polygon& a, const Line& l)
{
Polygon ret;
int n = a.size();
for (int i = 0; i < n; i++) {
const Point& now = a[i];
const Point& nxt = a[(i + 1) % n];
auto cf = toleft(now, l);
auto cs = toleft(nxt, l);
if (cf >= 0) {
ret.emplace_back(now);
}
if (cf * cs < 0) {
ret.emplace_back(crosspointLL(Line(now, nxt), l));
}
}
return ret;
}
// 最远点对(旋转卡壳)凸多边形 如果存在三点共线 先求凸包弹出共线点 不然在大小3的时候 会死循环
db rotatingCalipers(Polygon a)
{
int n = a.size();
if (n <= 2) return distance(a[0], a[1]);
int i = 0, j = 0;
for (int k = 0; k < n; k++) {
if (a[k] < a[i]) i = k;
if (a[j] < a[k]) j = k;
}
db res = 0;
int si = i, sj = j;
while (i != sj || j != si) {
res = max(res, distance(a[i], a[j]));
if (crossOp(a[(i + 1) % n] - a[i], a[(j + 1) % n] - a[j]) < 0)
i = (i + 1) % n;
else
j = (j + 1) % n;
}
return res;
}
// 分治法最近点对
db closestPair(Polygon s)
{
sort(s.begin(), s.end());
int n = s.size();
if (n <= 1) return inf;
int m = n / 2;
db x = s[m].x;
db res = min(closestPair(Polygon(s.begin(), s.begin() + m)),
closestPair(Polygon(s.begin() + m, s.end())));
sort(s.begin(), s.end());
deque<int> deq;
for (int i = 0; i < n; i++) {
if (cmp(abs(s[i].x - x), res) >= 0) continue;
while (!deq.empty() && cmp(s[deq.front()].y, s[i].y - res) <= 0)
deq.pop_front();
for (auto e : deq) res = min(res, distance(s[i], s[e]));
deq.push_back(i);
}
return res;
}
struct Circle {
Point o;
db r;
Circle() {}
Circle(Point o_, db r_) { o = o_, r = r_; }
friend istream& operator>>(istream& is, Circle& c)
{
return is >> c.o >> c.r;
}
};
// 4 相离 3 外切 2 相交 1 内切 0 包含
int crossCC(Circle c1, Circle c2)
{
if (c1.r < c2.r) swap(c1, c2);
db d = len(c1.o - c2.o);
if (sgn(c1.r + c2.r - d) == -1) return 4;
if (sgn(c1.r + c2.r - d) == 0) return 3;
if (sgn(c1.r - c2.r - d) == -1) return 2;
if (sgn(c1.r - c2.r - d) == 0) return 1;
return 0;
}
int pointInCircle(const Point& p, const Circle& c)
{
db d = distance(c.o, p);
int cp = cmp(d, c.r);
if (cp > 0) return OUT;
if (cp < 0) return IN;
return ON;
}
Circle incircle_triangle(Point a, Point b, Point c)
{
db A = len(b - c), B = len(c - a), C = len(a - b);
Point o = a * A + b * B + c * C;
o /= A + B + C;
db r = len(cross(o - a, b - a) / len(b - a));
return { o, r };
}
Circle circumcircle_triangle(Point a, Point b, Point c)
{
db A = square(b - c);
db B = square(c - a);
db C = square(a - b);
db s = A * (B + C - A), t = B * (C + A - B), u = C * (A + B - C);
db l = s + t + u;
s /= l, t /= l, u /= l;
Point o = a * s + b * t + c * u;
db r = len(a - o);
return { o, r };
}
bool intersect(const Circle& c, const Line& l)
{
return cmp(c.r, distancePL(c.o, l)) >= 0;
}
// 0 圆的外部,内部包括圆上包含线段 1 严格穿过圆
// 2圆心在s的投影点在线段s上(不包括端点)
int intersect(const Circle& c, const Segment& s)
{
Point h = projection(c.o, s);
if (cmp(distance(c.o, h), c.r) > 0) return 0;
db d1 = len(c.o - s.a), d2 = len(c.o - s.b);
if (cmp(c.r, d1) >= 0 && cmp(c.r, d2) >= 0) return 0;
if (cmp(c.r, d1) * cmp(c.r, d2) < 0) return 1;
if (sgn(dot(s.a - h, s.b - h)) < 0) return 2;
return 0;
}
// l1 l2 的对称轴
vector<Line> corner(Line l1, Line l2)
{
vector<Line> res;
if (parallel(l1, l2)) {
db d = distancePL(l2.a, l1) / 2.0;
Point v1 = l1.b - l1.a;
v1 = unit(v1) * d;
Point p = l2.a + rotleft(v1);
db d1 = distancePL(p, l1);
db d2 = distancePL(p, l2);
if (abs(d1 - d2) > d) {
p = l2.a + rotright(v1);
}
res.push_back(Line(p, p + v1));
}
else {
Point p = crosspointLL(l1, l2);
Point v1 = l1.b - l1.a, v2 = l2.b - l2.a;
v1 = unit(v1);
v2 = unit(v2);
res.push_back(Line(p, p + (v1 + v2)));
res.push_back(Line(p, p + rotleft(v1 + v2)));
}
return res;
}
vector<Point> crosspointCL(Circle c, Line l)
{
Point h = projection(c.o, l);
db d = c.r * c.r - square(c.o - h);
if (sgn(d) == -1) return {};
if (sgn(d) == 0) return { h };
Point x = unit(l.a - l.b) * sqrt(d);
return { h - x, h + x };
}
Polygon crosspointCS(const Circle& c, const Segment& s)
{
int num = intersect(c, s);
if (num == 0) return {};
auto res = crosspointCL(c, Line(s.a, s.b));
if (num == 2) return res;
if (sgn(dot(s.a - res[0], s.b - res[0])) > 0) swap(res[0], res[1]);
return { res[0] };
}
Polygon crosspointCC(Circle c1, Circle c2)
{
db r1 = c1.r, r2 = c2.r;
if (r1 < r2) return crosspointCC(c2, c1);
db d = len(c2.o - c1.o);
int op = crossCC(c1, c2);
if (op == 4 || op == 0) return {};
Point v = c2.o - c1.o;
if (op == 3 || op == 1) return { c1.o + unit(v) * r1 };
db p = ((r1 * r1 - r2 * r2) / d + d) / 2, q = sqrt(r1 * r1 - p * p);
Point h = c1.o + unit(v) * p;
Point i = unit(rotleft(v));
return { h + i * q, h - i * q };
}
// p1,p2 的角平分线 在p1p2逆时针方向
Line bisector(Point p1, Point p2)
{
Circle c1 = Circle(p1, len(p1 - p2)), c2 = Circle(p2, len(p1 - p2));
auto p = crosspointCC(c1, c2);
if (cross(p2 - p1, p[0] - p1) > 0) swap(p[0], p[1]);
return Line(p[0], p[1]);
}
// 点到圆的切点
Polygon tangent_to_circle(const Circle& c, const Point& p)
{
return crosspointCC(c, Circle(p, sqrt(square(c.o - p) - c.r * c.r)));
}
// 两圆公切线
vector<Line> common_tangent(const Circle& c1, const Circle& c2)
{
if (c1.r < c2.r) return common_tangent(c2, c1);
vector<Line> res;
db g = distance(c1.o, c2.o);
if (sgn(g) == 0) return res;
Point u = (c2.o - c1.o) / g, v = rotleft(u);
// -1 外公切线 1 内公切线
for (int s : {-1, 1}) {
db h = (c1.r + c2.r * s) / g;
if (cmp(1, h * h) == 0)
res.emplace_back(c1.o + u * c1.r, c1.o + (u + v) * c1.r);
else if (cmp(1, h * h) > 0) {
Point U = u * h, V = v * sqrt(1 - h * h);
res.emplace_back(c1.o + (U + V) * c1.r, c2.o - (U + V) * c2.r * s);
res.emplace_back(c1.o + (U - V) * c1.r, c2.o - (U - V) * c2.r * s);
}
}
return res;
}
// 三角剖分 一个端点在圆心的三角形和圆的2倍面积并
db commonarea_impl(const Circle& c, const Point& a, const Point& b)
{
auto va = c.o - a, vb = c.o - b;
db f = cross(va, vb), res = 0;
if (sgn(f) == 0) return res;
if (cmp(max(len(va), len(vb)), c.r) <= 0) return f;
if (cmp(distancePS(c.o, Segment(a, b)), c.r) >= 0)
return c.r * c.r * arg(Point(dot(va, vb), cross(va, vb)));
auto cand = crosspointCS(c, Segment(a, b));
if (cand.empty()) return res;
if (cand.size() > 1u && dot(cand[1] - cand[0], a - cand[0]) > 0)
swap(cand[0], cand[1]);
cand.emplace(cand.begin(), a);
cand.emplace_back(b);
for (int i = 0; i + 1 < cand.size(); i++)
res += commonarea_impl(c, cand[i], cand[i + 1]);
return res;
}
db commonarea(const Circle& c, const Polygon& P)
{
if (P.size() < 3) return 0;
db res = 0;
int n = P.size();
for (int i = 0; i < n; i++) res += commonarea_impl(c, P[i], P[(i + 1) % n]);
return res / 2;
}
db commonarea(Circle c1, Circle c2)
{
db r1 = c1.r, r2 = c2.r;
db d = len(c1.o - c2.o);
if (cmp(r1 + r2, d) <= 0) return 0;
if (cmp(fabs(r1 - r2), d) >= 0) return pi * min(r1, r2) * min(r1, r2);
db res = 0;
for (int _ = 0; _ < 2; _++) {
r1 = c1.r, r2 = c2.r;
db cosine = (d * d + r1 * r1 - r2 * r2) / (2 * d * r1);
db theta = acos(cosine) * 2;
res += (theta - sin(theta)) * r1 * r1 / 2;
swap(c1, c2);
}
return res;
}
// 已知两点半径,求圆心位置
vector<Point> center_given_radius(const Point& a, const Point& b, const db& r)
{
Point m = (b - a) * 0.5;
db d1 = len(m);
if (sgn(d1) == 0 || d1 > r) return {};
db d2 = sqrt(r * r - d1 * d1);
Point n = rotleft(m) * d2 / d1;
Point p = a + m - n, q = a + m + n;
if (p == q) return { p };
return { p, q };
}
void solve()
{
int n;
cin >> n;
Polygon P(n);
for (int i = 0; i < n; i++)cin >> P[i];
cout << fixed << setprecision(10) << closestPair(P) << "\n";
}
int main()
{
#ifdef LOCAL
#ifdef OPENSTACK
int size = 128 << 20; // 64MB
char* p = (char*) malloc(size) + size;
#if (defined _WIN64) or (defined __unix)
__asm__("movq %0, %%rsp\n" ::"r"(p));
#else
__asm__("movl %0, %%esp\n" ::"r"(p));
#endif
#endif
#endif
IOS;
int _ = 1;
while (_--) {
solve();
}
#ifdef LOCAL
#ifdef OPENSTACK
exit(0);
#else
return 0;
#endif
#endif
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 15
Accepted
time: 2ms
memory: 4100kb
input:
2933 19320 28055 2053 27470 14635 1378 27582 9822 28729 107 22351 3093 17670 379 23901 4686 27182 12261 19443 8467 24208 20283 10763 10584 25953 28380 28290 27394 19572 14769 4024 12401 23295 3267 26949 176 13416 4517 23856 15413 26260 18957 18275 24409 999 3873 28202 14686 25446 2822 24009 8949 114...
output:
2.8284271247
result:
ok found '2.8284271', expected '2.8284271', error '0.0000000'
Test #2:
score: 15
Accepted
time: 2ms
memory: 4100kb
input:
2912 721 22031 501 17261 11583 2570 25091 26662 7053 8645 13085 13755 15427 10176 10602 28715 16277 17856 9356 11466 5758 16745 4367 27948 15523 3209 27447 13908 24316 27667 11649 8344 9848 2897 219 21503 22524 11664 5725 1460 24127 12567 25935 14858 8457 13415 16347 12044 28163 753 28967 22202 2418...
output:
8.6023252670
result:
ok found '8.6023253', expected '8.6023253', error '0.0000000'
Test #3:
score: 15
Accepted
time: 2ms
memory: 4016kb
input:
2919 2259 8882 27694 23328 12744 20731 7265 21050 9456 6920 13055 18791 28400 8457 16815 27147 17978 11787 8903 7696 17316 10505 28428 15732 15370 9751 23862 25477 5316 5647 24987 27499 11625 15403 27782 4138 9728 5740 18123 13962 2177 7071 27078 7038 4083 2679 28762 5376 16196 6309 2708 25797 23383...
output:
14.1421356237
result:
ok found '14.1421356', expected '14.1421356', error '0.0000000'
Test #4:
score: 15
Accepted
time: 0ms
memory: 4164kb
input:
2998 25897 23111 13024 10321 15964 26479 17278 5912 13799 21852 20180 4213 27326 12582 1533 11852 16882 2495 528 13201 21465 18041 540 4999 28233 3336 9986 1089 6821 20255 3089 17725 4583 22110 3588 8106 25230 22362 18344 2991 26627 13592 29199 19 23076 17065 20627 9037 639 2945 26311 15104 4108 118...
output:
8.4852813742
result:
ok found '8.4852814', expected '8.4852814', error '0.0000000'
Test #5:
score: 15
Accepted
time: 2ms
memory: 4088kb
input:
2969 20252 368 21295 919 29391 369 18543 2203 14469 6782 5248 23342 7294 9742 21414 29623 745 21715 26138 28081 29054 22366 17394 24941 17790 16310 9892 3947 25729 28818 27425 15079 21592 28422 12126 2901 10434 25370 6757 24560 1388 2072 22096 2842 13285 18508 13305 8648 10845 17840 10651 19691 1118...
output:
2.2360679775
result:
ok found '2.2360680', expected '2.2360680', error '0.0000000'
Test #6:
score: 15
Accepted
time: 2ms
memory: 4168kb
input:
2906 2294 19051 9437 28110 3472 25345 22267 17834 15400 6045 12007 5001 27379 24499 15386 10583 10415 18346 14140 8534 16468 6545 22225 132 18670 27325 16117 5289 20838 20510 7406 8688 9684 4688 5594 1497 10942 25637 3335 11901 27199 13109 26244 12524 4495 24312 17605 9663 7320 18280 19337 752 647 8...
output:
3.0000000000
result:
ok found '3.0000000', expected '3.0000000', error '0.0000000'
Test #7:
score: 15
Accepted
time: 2ms
memory: 4060kb
input:
2914 4767 25591 11281 25693 15021 8027 13143 18347 12872 16822 3252 25409 22023 365 23139 25813 3372 5371 21880 7390 21400 7290 20972 24123 24122 19495 13975 6046 426 13364 4671 18671 1039 6519 3279 28542 20995 12797 2488 25887 14985 7139 28322 23785 9612 777 4453 26877 3703 5074 21602 1418 5867 123...
output:
7.0710678119
result:
ok found '7.0710678', expected '7.0710678', error '0.0000000'
Test #8:
score: 15
Accepted
time: 2ms
memory: 4088kb
input:
2979 7893 7802 20059 24540 20875 24953 2547 12366 467 16268 20147 26084 5925 18991 13710 25946 10693 800 4219 20513 17462 29331 21881 20614 3569 15805 3926 7909 9560 12579 20336 29519 16906 6613 21462 1275 21522 16591 3024 2941 8360 3888 22198 17328 2785 4662 15226 11189 2407 13438 20632 9776 17201 ...
output:
10.1980390272
result:
ok found '10.1980390', expected '10.1980390', error '0.0000000'
Test #9:
score: 15
Accepted
time: 2ms
memory: 4024kb
input:
2905 5544 16176 11504 10282 2559 25147 13685 28854 22579 1388 17317 1984 6352 11519 7336 2667 1316 1562 2609 7357 7088 14893 9314 17654 8800 27115 14676 25451 27421 25801 14436 10942 18523 25981 8686 16405 9068 26827 19020 9730 22399 23805 19890 935 17751 418 12577 8081 21912 26733 8184 2548 3106 57...
output:
6.4031242374
result:
ok found '6.4031242', expected '6.4031242', error '0.0000000'
Test #10:
score: 15
Accepted
time: 2ms
memory: 4168kb
input:
2913 11370 12601 5375 12389 19018 10607 13570 24071 14694 4758 24116 28315 8846 9892 5535 6561 19331 24958 4453 11136 17257 13976 18700 25978 12828 5326 18400 2999 28598 12038 11237 24265 19317 23350 23606 1097 17475 28271 14115 3082 19230 15682 11040 22141 1420 22549 4899 19979 3065 11184 3747 1800...
output:
5.8309518948
result:
ok found '5.8309519', expected '5.8309519', error '0.0000000'
Test #11:
score: 15
Accepted
time: 2ms
memory: 4092kb
input:
2901 5137 5191 14939 18114 686 17953 6125 13559 12280 1161 15748 8778 17324 19812 8066 3377 2005 2060 8279 4712 7962 15638 14804 20785 15838 27468 16022 20920 25191 25886 6271 4511 4454 15500 20878 22558 3180 25018 19403 25897 21777 27083 12010 11560 10476 264 26322 19410 18624 17218 10503 20845 259...
output:
7.6157731059
result:
ok found '7.6157731', expected '7.6157731', error '0.0000000'
Test #12:
score: 15
Accepted
time: 0ms
memory: 4032kb
input:
2967 21729 13901 14984 631 9715 1243 12044 14302 14184 8687 20119 29500 1630 1679 9252 12762 10333 27445 7692 14205 24226 26191 21430 12595 9680 15025 21082 26361 14265 17819 25234 10290 13284 12284 20496 7051 21080 11310 4705 10426 17813 642 21653 24564 2062 8482 24447 20009 10529 13105 12674 26203...
output:
8.4852813742
result:
ok found '8.4852814', expected '8.4852814', error '0.0000000'
Test #13:
score: 15
Accepted
time: 2ms
memory: 4160kb
input:
2950 7362 24422 1860 4478 4410 20906 17675 28679 22144 9650 13906 9626 3575 6716 25789 8384 21148 22996 26367 9570 7556 6448 3779 18005 22189 19415 5862 29338 21366 15894 12941 13944 193 16242 11933 16827 11801 21990 18316 7782 4360 6788 25496 6710 18676 20844 4232 6605 23089 7720 17360 16692 24024 ...
output:
10.0498756211
result:
ok found '10.0498756', expected '10.0498756', error '0.0000000'
Test #14:
score: 15
Accepted
time: 2ms
memory: 4104kb
input:
2917 3911 20228 26229 16985 6337 20601 13694 9726 10128 10943 25677 25223 25291 5475 11046 1831 13363 24845 8261 15776 19724 13227 7003 15308 10691 2884 6642 24024 19525 4190 19255 9234 19616 18420 11638 11857 7321 9586 2771 24180 16225 27275 15413 19921 13640 7909 4185 5680 26864 9599 11633 13331 2...
output:
4.0000000000
result:
ok found '4.0000000', expected '4.0000000', error '0.0000000'
Test #15:
score: 15
Accepted
time: 0ms
memory: 4100kb
input:
2953 6440 27024 3143 7572 12164 9883 7992 20360 12891 27207 8893 26234 27208 23549 26161 17785 1612 5621 23610 25805 23114 20452 22679 5627 3161 20418 3125 14236 8205 22564 22236 20417 7014 2299 14401 13890 10192 764 25652 11079 8545 25856 8699 6659 24623 16136 27334 5021 28502 14724 5868 16745 8891...
output:
7.8102496759
result:
ok found '7.8102497', expected '7.8102497', error '0.0000000'
Test #16:
score: 15
Accepted
time: 2ms
memory: 4100kb
input:
2936 7212 5833 853 20043 14934 21745 319 19625 17764 3072 18093 27900 16870 17341 24195 5935 5277 8550 16626 24384 22923 5768 28137 14009 2962 19530 27438 19854 1497 7607 17108 21621 12092 24625 11541 23149 16404 9327 21561 8404 21344 14713 3743 16350 8421 15840 24854 16508 3839 20418 14548 10571 10...
output:
8.9442719100
result:
ok found '8.9442719', expected '8.9442719', error '0.0000000'
Test #17:
score: 15
Accepted
time: 2ms
memory: 4036kb
input:
2922 11867 22431 23784 23207 2701 6297 23091 23564 8208 23903 9411 16139 3518 12786 6372 16353 6684 6476 13858 19707 12823 14107 27785 2315 27248 29215 5369 26980 15845 5189 19775 21600 14293 14306 14340 13448 17993 8321 6603 4172 1557 9774 15417 6388 27265 26863 10964 4618 2999 17351 27003 7129 218...
output:
12.2065556157
result:
ok found '12.2065556', expected '12.2065556', error '0.0000000'
Test #18:
score: 15
Accepted
time: 2ms
memory: 4084kb
input:
2980 11254 1334 9778 19499 5121 24775 29371 1215 805 9394 25571 19604 14056 21077 9645 25856 16724 12217 8736 4014 4255 20515 25600 14975 26486 11497 19932 26496 23823 5450 12240 3428 5545 22019 10851 26015 2979 19067 13271 9885 7252 6620 654 4326 7651 10957 3676 5901 17583 29234 3595 12212 5593 222...
output:
6.3245553203
result:
ok found '6.3245553', expected '6.3245553', error '0.0000000'
Test #19:
score: 15
Accepted
time: 2ms
memory: 4032kb
input:
2917 3367 18980 23528 8138 27340 9571 19491 4017 6977 23850 26904 12719 25057 24981 3293 27877 6044 20776 25826 18719 14878 18848 18735 24895 3470 23564 19814 15277 8987 1356 9738 21252 20411 16713 14956 1183 4529 19278 14971 26277 27852 8264 14382 15808 24888 15254 24451 7534 25957 20715 18641 6484...
output:
5.3851648071
result:
ok found '5.3851648', expected '5.3851648', error '0.0000000'
Test #20:
score: 15
Accepted
time: 2ms
memory: 4036kb
input:
2995 7906 1744 9243 6420 15669 14807 9731 21221 12244 2360 1559 10270 11032 2541 29796 12578 14944 11651 492 3865 17644 1699 25261 15215 11454 8869 4798 11221 18260 17579 16377 27554 9921 2894 16002 14046 20837 11352 8951 17198 1590 2548 12262 2823 2830 13661 25604 11582 7317 28810 16910 20993 8851 ...
output:
2.2360679775
result:
ok found '2.2360680', expected '2.2360680', error '0.0000000'
Test #21:
score: 15
Accepted
time: 2ms
memory: 4112kb
input:
2916 2659 12063 29048 3837 12921 16927 25369 1985 21936 9274 838 12881 25577 15592 17029 27951 27320 25494 5664 24546 7520 10863 12037 25591 12285 20504 19922 13943 10733 18874 15986 27043 17442 21827 1068 20502 24938 28643 9385 11729 26704 3574 13177 15579 8068 19073 23256 19983 7753 15282 11061 32...
output:
8.0622577483
result:
ok found '8.0622577', expected '8.0622577', error '0.0000000'
Test #22:
score: 15
Accepted
time: 2ms
memory: 4024kb
input:
2986 25036 5674 27102 28657 17291 21383 26798 17483 5866 19405 22915 492 21588 22476 21180 26921 10722 24624 2822 10847 10570 21259 28394 891 2424 15212 24772 5441 12784 25217 15361 27799 16419 15818 11434 6955 25751 23354 28526 726 15471 9264 11205 23092 5151 26124 21533 5682 24854 4772 18756 2116 ...
output:
8.9442719100
result:
ok found '8.9442719', expected '8.9442719', error '0.0000000'
Test #23:
score: 15
Accepted
time: 2ms
memory: 4084kb
input:
2915 11959 10944 6844 2135 19931 15744 17370 22481 9410 26716 9927 7145 12463 3803 27910 7968 7690 8011 28606 9533 16608 23431 28868 15044 5554 4978 9973 9999 9846 13469 10906 21470 5026 13047 13194 5443 9165 14245 10297 22879 18096 12643 28526 7096 9333 20703 4666 20780 12817 12301 17142 3592 21786...
output:
4.4721359550
result:
ok found '4.4721360', expected '4.4721360', error '0.0000000'
Test #24:
score: 15
Accepted
time: 2ms
memory: 4104kb
input:
2918 13226 960 18776 1035 3763 6903 16641 14049 22774 27989 10458 2445 24147 16251 1359 5095 18700 7861 11313 5609 19748 24639 16966 14605 19874 17344 28167 510 11603 15724 18429 22997 15075 18503 16574 7070 14089 6225 6740 26465 25585 7907 23162 7411 17124 9468 5271 13017 25508 14679 29158 18584 28...
output:
8.0622577483
result:
ok found '8.0622577', expected '8.0622577', error '0.0000000'
Test #25:
score: 15
Accepted
time: 2ms
memory: 4028kb
input:
2941 2515 11060 12391 18270 12207 15742 789 16796 13197 22131 13415 2860 12082 2093 7710 18754 24856 14711 12800 14171 16632 11423 4145 12921 22102 9753 973 12380 25190 8081 17996 4071 15527 1847 22706 8645 16510 22805 13012 24167 2100 17354 1351 14565 14421 2184 28580 26689 12337 21324 13578 10620 ...
output:
9.2195444573
result:
ok found '9.2195445', expected '9.2195445', error '0.0000000'
Test #26:
score: 15
Accepted
time: 2ms
memory: 4032kb
input:
2952 27006 21055 21695 8703 16788 548 17781 1557 152 22571 19310 14500 5174 3255 2978 7868 21502 13962 16832 27578 907 26747 14180 10886 13421 11871 18761 6859 2238 18254 1510 16211 7541 4422 8578 6150 10385 292 9226 16499 15724 24646 19360 5613 4005 580 12538 19385 29347 21408 26049 22123 11988 154...
output:
2.0000000000
result:
ok found '2.0000000', expected '2.0000000', error '0.0000000'
Test #27:
score: 15
Accepted
time: 2ms
memory: 4172kb
input:
2968 27040 16519 14183 19791 3125 20952 22282 25359 25548 6268 23878 17109 20146 7598 28240 12251 24721 22566 18738 2100 26426 19382 27495 22285 17430 15986 14285 15002 7571 27219 15319 16862 3421 1797 6078 14500 8240 27572 1321 14317 27349 18018 24697 15928 6697 16602 4570 13433 28339 5783 24341 52...
output:
5.0990195136
result:
ok found '5.0990195', expected '5.0990195', error '0.0000000'
Test #28:
score: 15
Accepted
time: 2ms
memory: 4120kb
input:
2984 18986 28299 7248 23914 14926 13783 27231 8565 9082 22520 16075 28457 16920 12096 22078 29824 15653 9346 14454 28788 7235 463 61 22498 9337 617 999 12172 1300 14935 15300 20750 5393 15517 27048 24617 13795 29708 12096 9699 5690 22291 6995 9723 435 4027 14210 12946 8990 10901 28186 9780 27115 110...
output:
5.0000000000
result:
ok found '5.0000000', expected '5.0000000', error '0.0000000'
Test #29:
score: 15
Accepted
time: 2ms
memory: 4104kb
input:
2972 19214 11746 17099 519 2063 17481 27868 112 22053 15598 26148 19256 1946 25408 19687 12216 28998 1453 24560 1679 5725 669 14033 12219 2981 21304 4860 26311 7729 5463 26884 18092 7362 4102 23826 4238 17770 6239 27858 26134 7535 10903 27558 24855 2176 9520 480 16363 9163 28610 8099 19887 16176 124...
output:
4.4721359550
result:
ok found '4.4721360', expected '4.4721360', error '0.0000000'
Test #30:
score: 15
Accepted
time: 2ms
memory: 4104kb
input:
2931 19129 5822 6157 5376 516 22424 11325 23144 26707 4041 1661 611 6479 8279 2899 4971 9059 4634 24940 1524 26211 17398 16166 6440 11176 13589 25933 14572 21266 7600 1559 2441 6365 18866 19580 17148 18096 22224 21485 14976 2479 24921 5257 12170 615 26080 5483 25686 1550 8074 23255 27348 24483 9570 ...
output:
10.8166538264
result:
ok found '10.8166538', expected '10.8166538', error '0.0000000'
Test #31:
score: 15
Accepted
time: 0ms
memory: 4100kb
input:
2907 13283 4317 22976 12947 21685 12697 538 26187 22939 5306 9764 854 12757 18488 26538 24873 26468 6939 135 13398 3639 12964 27851 12209 27128 16924 10293 17450 2469 14169 2328 3820 7118 12498 25537 23324 12197 7909 5427 25617 12939 6001 5968 13345 27640 6993 28836 19040 19642 15179 23520 8917 4941...
output:
6.4031242374
result:
ok found '6.4031242', expected '6.4031242', error '0.0000000'
Test #32:
score: 15
Accepted
time: 0ms
memory: 4092kb
input:
2943 10637 10164 28440 3846 9278 1735 2808 17725 631 14847 20293 18334 15228 25650 4657 5271 18042 25859 5489 6050 18617 9849 23124 23233 26437 16870 10646 11353 6864 2297 17539 11293 24956 9003 26607 4219 27505 4346 23815 3950 26812 4087 24085 21297 27351 10483 13033 24166 12465 13319 1815 9049 257...
output:
6.0827625303
result:
ok found '6.0827625', expected '6.0827625', error '0.0000000'
Test #33:
score: 15
Accepted
time: 2ms
memory: 4088kb
input:
2998 15290 14220 283 14120 24192 12310 2940 1081 7887 12247 27901 18448 9132 22378 10437 7742 8470 14036 17785 604 6414 21380 24140 22158 20028 5041 9918 2001 20289 20102 1971 14022 5247 8295 8592 28282 12678 22824 12287 22132 27808 16557 18885 25013 4709 6868 27837 28365 7986 7131 13857 2570 20050 ...
output:
11.3137084990
result:
ok found '11.3137085', expected '11.3137085', error '0.0000000'
Test #34:
score: 15
Accepted
time: 0ms
memory: 4020kb
input:
2968 7570 27013 14588 17939 828 27707 4928 17406 17553 2873 8532 7895 25323 14759 10158 9183 7211 89 17134 23405 1045 18447 29538 15407 1808 11114 28064 3128 6948 11688 19880 15006 16597 9373 15665 14447 25259 28298 2819 16354 21115 4602 8814 17253 15922 10099 21338 24646 21461 23951 1374 8150 28547...
output:
3.0000000000
result:
ok found '3.0000000', expected '3.0000000', error '0.0000000'
Test #35:
score: 15
Accepted
time: 2ms
memory: 4048kb
input:
2916 12531 13180 15101 5303 15796 1969 1347 21762 9995 4819 17324 20978 24752 4755 10480 5827 9801 9643 28969 1039 18230 6510 23084 28742 19788 8158 9849 3752 19280 8245 9251 5510 24748 14373 8397 26872 18788 26140 15196 8491 21667 8115 246 25766 23543 838 20075 5666 10127 11347 325 7642 10786 20069...
output:
9.4868329805
result:
ok found '9.4868330', expected '9.4868330', error '0.0000000'
Test #36:
score: 15
Accepted
time: 2ms
memory: 4104kb
input:
2936 6453 12876 24725 13435 7848 23646 10889 27721 14395 10138 11313 7849 13261 2709 17829 26051 16584 11787 27060 16970 16052 3899 21459 23930 21639 5906 20365 5057 3186 14712 6665 3542 22928 21497 12935 16740 20320 25985 19707 354 634 26611 2411 6545 26818 23681 23807 5691 1040 12581 28886 27225 2...
output:
0.0000000000
result:
ok found '0.0000000', expected '0.0000000', error '-0.0000000'
Test #37:
score: 15
Accepted
time: 2ms
memory: 4080kb
input:
2917 24527 9618 19373 1061 10969 9145 3450 12526 3744 27011 12109 15429 21824 4361 26057 21319 20946 24428 21338 3445 5247 25243 1467 7948 13158 25196 9770 20957 20503 15784 1960 26343 15197 21664 21958 13738 4994 20967 18705 26847 18697 26446 12505 27261 13471 14808 13554 20323 12733 23329 19907 17...
output:
8.0622577483
result:
ok found '8.0622577', expected '8.0622577', error '0.0000000'
Test #38:
score: 15
Accepted
time: 2ms
memory: 4084kb
input:
2990 18863 24278 5755 5746 18040 29300 29503 9159 23012 16447 5698 9672 17698 11625 3616 18133 11349 12386 1734 5612 16451 8041 19271 28290 15891 17435 25190 2848 25488 7913 13767 13833 26942 2609 17582 14489 10301 12244 2727 16570 1961 23926 15889 24967 24012 24137 23049 21833 21977 21975 26757 780...
output:
6.0827625303
result:
ok found '6.0827625', expected '6.0827625', error '0.0000000'
Test #39:
score: 15
Accepted
time: 2ms
memory: 4112kb
input:
2969 19116 7602 15733 28966 6408 3282 10421 18848 17444 9683 5300 24603 3887 8286 10703 28128 6379 25685 17433 18047 12705 16616 18556 4460 20272 10768 19953 4504 4534 14105 2849 16119 9259 5214 5840 22104 1159 14556 18747 5422 21580 28339 18130 7058 660 16422 5610 14480 5670 8668 19445 15347 9839 2...
output:
7.0000000000
result:
ok found '7.0000000', expected '7.0000000', error '0.0000000'
Test #40:
score: 15
Accepted
time: 0ms
memory: 4168kb
input:
2949 23541 6898 11443 16672 21526 28185 1817 12786 4214 21648 25092 4921 21122 856 29439 6337 16948 15879 4280 21325 19121 14848 12911 21613 13094 5597 15326 29088 25873 24367 17722 3787 28210 11363 6730 28989 15807 13710 26007 10723 22374 25917 14764 24201 24676 7383 24544 15723 19904 8228 6363 276...
output:
2.8284271247
result:
ok found '2.8284271', expected '2.8284271', error '0.0000000'
Test #41:
score: 15
Accepted
time: 2ms
memory: 4048kb
input:
2986 46377 1661787 344031 1172699 1289803 1308005 142523 2317602 1288398 1099383 1850031 2966705 1622506 976777 1834568 1620753 1784098 43667 307307 1985842 2020354 302266 454746 2142954 2766107 358413 1446300 439120 514807 645262 1631949 75800 2503995 685007 1190479 978020 784991 583242 1100198 290...
output:
1375.4911849954
result:
ok found '1375.4911850', expected '1375.4911850', error '0.0000000'
Test #42:
score: 15
Accepted
time: 2ms
memory: 4100kb
input:
2995 1959460 118442 1779520 1437049 1884265 1050379 1016710 182612 2363938 2620553 275946 1255304 2894307 919707 199871 2677750 2375954 727544 2766730 1768924 1244629 199341 2670812 2044943 1734788 2415090 1918962 1629295 2808722 1909677 1705048 1045882 2823067 1491607 2804939 1949043 1119591 258147...
output:
118.8486432400
result:
ok found '118.8486432', expected '118.8486432', error '0.0000000'
Test #43:
score: 15
Accepted
time: 2ms
memory: 4036kb
input:
2933 1429815 2093814 2133850 950822 583563 1060858 2584699 467925 539634 911852 446442 270933 627571 1387604 465986 1473218 1172831 66280 33761 535663 567119 2370789 1376415 1858060 1431539 742019 2716672 2772597 1317458 101695 1502402 2515007 2541086 604812 761567 948358 1581972 2329247 1480800 142...
output:
103.2375900532
result:
ok found '103.2375901', expected '103.2375901', error '0.0000000'
Test #44:
score: 15
Accepted
time: 2ms
memory: 4032kb
input:
2940 1422585 2658910 509153 2250447 2328342 559000 1942241 891946 217500 1628220 2648161 735804 2756850 1228799 1421621 529651 1897017 1508114 1834780 2221348 2917978 500146 1703968 2912230 219705 2767589 1621050 299446 2791550 1954660 91128 1107487 383849 1558866 2269615 1984836 242479 779688 15834...
output:
913.8933198136
result:
ok found '913.8933198', expected '913.8933198', error '0.0000000'
Test #45:
score: 15
Accepted
time: 2ms
memory: 4108kb
input:
2974 133448 1120280 2579338 2836020 2074449 1081717 169691 1138398 801452 900850 1559928 1696261 2341566 305400 2118368 934376 2363648 1442663 2252745 2628923 1986565 1951439 2782158 2861395 1027081 1360607 2953651 1234054 1745700 2906212 584272 1097264 2412741 2352462 2464352 1043790 2011468 107846...
output:
1141.7955158434
result:
ok found '1141.7955158', expected '1141.7955158', error '0.0000000'
Test #46:
score: 15
Accepted
time: 2ms
memory: 4060kb
input:
2937 2862577 214574 1690219 1223226 2513868 2026615 2462005 1307122 1671207 1374111 1130600 126577 2851262 1846199 2484557 1369028 120856 1380042 1080298 1581538 299128 992012 2599941 596701 2217191 1838372 2528202 1404507 417929 1767720 272247 2726035 376992 2359646 1731797 1113248 1508711 194594 1...
output:
551.3410922469
result:
ok found '551.3410922', expected '551.3410922', error '0.0000000'
Test #47:
score: 15
Accepted
time: 2ms
memory: 4084kb
input:
2949 917304 2319838 853129 2646922 1755439 464870 90470 49935 350143 2759802 1753822 2805734 2744427 609937 2413429 2335215 2103947 2386972 2885080 22256 622888 2058911 1753161 24612 1365904 2578076 2737821 1649878 563879 5562 2199438 1981792 2763253 1924330 21298 503626 1215154 746844 2799550 20849...
output:
831.4162615682
result:
ok found '831.4162616', expected '831.4162616', error '0.0000000'
Test #48:
score: 15
Accepted
time: 0ms
memory: 4084kb
input:
2969 612692 1859977 2562195 1439397 1643396 547807 670036 2891940 30463 137947 901371 785101 293386 1204296 2250995 2410215 1512588 2375836 216724 262143 1994335 225627 1001941 2141311 2102804 2788635 521928 2212180 2332736 1525058 837359 2307824 2915185 1078029 1554960 1603557 2751358 1850380 12564...
output:
941.2980399427
result:
ok found '941.2980399', expected '941.2980399', error '0.0000000'
Test #49:
score: 15
Accepted
time: 2ms
memory: 4088kb
input:
2906 2883733 2774934 695696 290042 1842650 29002 1545869 1970147 76064 2741364 667842 362888 2602354 1020504 2244996 499520 2285516 2147553 1356151 1630754 912898 1189823 2404265 2724938 1688115 2107747 2428414 1140270 2272788 1059673 107501 102619 450745 1480945 569047 2175729 1876151 852258 666463...
output:
128.7361643051
result:
ok found '128.7361643', expected '128.7361643', error '0.0000000'
Test #50:
score: 15
Accepted
time: 2ms
memory: 4112kb
input:
2993 2957339 77766 2173029 2456725 910941 1585719 17677 483865 237094 1793660 2369425 2140359 363720 617346 2003465 2942179 2293949 2432230 819869 2130450 289106 2138186 1104563 1421028 680186 129706 706024 1061718 2279234 2159269 1980401 687541 492906 511253 82762 452904 2980751 1701528 2681368 978...
output:
746.4643327045
result:
ok found '746.4643327', expected '746.4643327', error '0.0000000'
Test #51:
score: 15
Accepted
time: 2ms
memory: 4084kb
input:
2984 5418117 412647 4001237 2578209 5393972 2715510 4593811 2444159 7816667 1697353 4369929 668929 8810424 471675 7823482 490406 8174532 2596834 6746737 2552932 892350 884130 2191080 2090860 7270972 855552 2554950 449222 4332183 233177 920617 106838 3637267 2859583 1936259 2834120 8518662 423658 721...
output:
1048.0405526505
result:
ok found '1048.0405527', expected '1048.0405527', error '0.0000000'
Test #52:
score: 15
Accepted
time: 2ms
memory: 4096kb
input:
2945 7240700 1899966 1090941 1961485 6683996 2564032 5602376 100552 6597536 451646 5906970 1028907 4571618 259063 3647418 94896 3007941 2159871 2956728 494861 4693534 811261 2041943 635510 4518588 2726535 53361 1080429 8815040 1977750 6699825 1207826 7667542 2230255 7910033 20087 8612667 1910203 618...
output:
1685.3065003138
result:
ok found '1685.3065003', expected '1685.3065003', error '0.0000000'
Test #53:
score: 15
Accepted
time: 2ms
memory: 4032kb
input:
2930 6511476 1715431 2131872 2637445 7008924 290383 8448046 29054 813832 1085423 5606528 2166948 2415092 1736163 5512124 2866556 5260592 2567796 1817403 281649 2913571 1497441 8687779 1623501 4407341 1122272 5040596 1733962 5917046 238351 199369 1161499 1059572 1551672 5709881 646826 663843 353502 3...
output:
350.6337120130
result:
ok found '350.6337120', expected '350.6337120', error '0.0000000'
Test #54:
score: 15
Accepted
time: 2ms
memory: 4096kb
input:
2908 5477483 1393304 2316042 1658183 532512 1153014 3044222 593163 5693712 1108195 1731659 15081 8188092 2650801 2670698 2384365 2653747 550897 1928234 1498168 5298127 253813 6008964 1366856 2848315 2316326 3353956 786374 1490077 1916817 2251743 1412895 2019858 1191185 3627718 2534329 6657110 460195...
output:
841.8515308533
result:
ok found '841.8515309', expected '841.8515309', error '0.0000000'
Test #55:
score: 15
Accepted
time: 2ms
memory: 4016kb
input:
2978 6796301 2064069 1939161 2099491 7117454 279435 8846978 2601798 393858 1650157 1831019 1506096 4910789 2836885 4791139 1397370 646515 2649718 3199287 681999 610732 1670793 1227312 1928619 4319731 1609342 1659367 639978 7173471 601280 1255518 1893832 6974569 2283339 2294668 1376727 8744472 996265...
output:
576.2360627382
result:
ok found '576.2360627', expected '576.2360627', error '0.0000000'
Test #56:
score: 0
Wrong Answer
time: 2ms
memory: 4092kb
input:
2922 13000 39000 6000 40000 26000 43000 48000 48000 20000 24000 51000 51000 44000 6000 42000 9000 12000 44000 53000 19000 47000 9000 30000 47000 20000 8000 32000 50000 30000 13000 53000 11000 33000 33000 39000 35000 23000 25000 51000 17000 35000 48000 44000 42000 45000 20000 39000 54000 32000 48000 ...
output:
409.3812404105
result:
wrong answer 1st numbers differ - expected: '366.3795846', found: '409.3812404', error = '0.1173691'
Subtask #2:
score: 0
Skipped
Dependency #1:
0%
Subtask #3:
score: 0
Skipped
Dependency #1:
0%
Subtask #4:
score: 0
Skipped
Dependency #1:
0%
Subtask #5:
score: 0
Skipped
Dependency #1:
0%