QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#736826 | #6426. Interested in Skiing | 2018LZY | AC ✓ | 5ms | 4048kb | C++14 | 16.6kb | 2024-11-12 13:34:15 | 2024-11-12 13:34:15 |
Judging History
answer
#include <bits/stdc++.h>
#define fi first
#define se second
#define mk make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define VT vector
#define pb push_back
#define SZ(a) ((int)a.size())
#define all(a) a.begin(), a.end()
#define TP template <class o>
#define TPP template <typename t1, typename t2>
#define rep(i, a, b) for (int i = a, i##ed_ = b; i <= i##ed_; i++)
#define REP(i, a, b) for (int i = b, i##st_ = a; i >= i##st_; i--)
#define FOR(i, n) rep(i, 1, n)
#define debug(x) cerr << #x << ' ' << '=' << ' ' << x << endl
using namespace std;
typedef double db;
typedef unsigned ui;
typedef long long ll;
typedef __int128 lll;
typedef long double ld;
typedef unsigned long long ull;
// char buf[1 << 20],*p1=buf,*p2=buf;
#define gc getchar() //(p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<20,stdin),p1==p2)?EOF:*p1++)
TP void qr(o& x) {
char c = gc; x = 0; int f = 1;
while (!isdigit(c)) {if (c == '-') f = -1; c = gc;}
while (isdigit(c)) x = x * 10 + c - '0', c = gc;
x *= f;
}
template <class o, class... O> void qr(o& x, O&... y) { qr(x), qr(y...); }
TP void qw(o x) {
if (x < 0) putchar('-'), x = -x;
if (x / 10) qw(x / 10);
putchar(x % 10 + '0');
}
TP void pr1(o x) { qw(x), putchar(' '); }
template <class o, class... O> void pr1(o x, O... y) { pr1(x), pr1(y...); }
TP void pr2(o x) { qw(x), putchar(10); }
template <class o, class... O> void pr2(o x, O... y) { pr2(x), pr2(y...); }
TP bool cmax(o& x, o y) { return (x < y ? x = y, 1 : 0); }
TP bool cmin(o& x, o y) { return (x > y ? x = y, 1 : 0); }
void yes(bool v) {puts(v ? "yes" : "no");}
void YES(bool v) {puts(v ? "YES" : "NO");}
void Yes(bool v) {puts(v ? "Yes" : "No");}
TP void order(VT<o> &a) { sort(all(a)); a.resize(unique(all(a)) - a.begin());}
TP int get_id(VT<o> &a, const o& val) {return lower_bound(all(a), val) - a.begin();}
TP void sort(o &v) {sort(all(v));}
TP o sorted(o v) {return sort(v), v;}
TP void reverse(o &v) {reverse(all(v));}
TP o reversed(o v) {return reverse(v), v;}
TP void unique(VT<o> &v) {v.erase(unique(all(v)), v.end());}
TP VT<o> uniqued(VT<o> v) {return unique(v), v;}
ll power(ll a, ll b, ll mod) {ll c=1; for(;b;b/=2,a=a*a%mod) if(b&1)c=c*a%mod;return c;}
TP o Pow(o a, ll b) {o c=o(1); for(; b;b/=2,a=a*a) if(b&1) c=c*a; return c;}
namespace geo {//Geometry几何
typedef double db;
typedef long double ld;
const int N = 210, M = 2e4 + 10;
const db eps = 1e-13, inf = 1.0 / 0.0, PI = acosl(-1.0); //精度
int sign(db x) {return x < -eps ? -1: (x > eps ? 1: 0);} // 符号位
struct P { // Point
db x, y;
P(db x = 0, db y = 0):x(x),y(y){}
TPP P(pair<t1, t2> a): x(a.fi), y(a.se) {}
P operator +(P b) const {return P(x + b.x, y + b.y);}
P operator -(P b) const {return P(x - b.x, y - b.y);}
P operator *(db t) const {return P(x * t, y * t);} // 数乘
P operator /(db t) const {return P(x / t, y / t);}
friend db dot(P a, P b) {return a.x * b.x + a.y * b.y;}//点乘
db operator *(P b) const {return x * b.y - y * b.x;} // 叉积
db operator ^(P b) const {return x * b.x + y * b.y;} // 点乘
db len() {return hypotl(x, y);} //求模长
friend db dis(P a, P b) {return (a - b).len();} // 两点距离
friend P normal(P a) {return P(-a.y, a.x);} //法向量(逆时针旋转90度)
friend P unit(P a) {return a / a.len();} //单位化
friend db slope(P a, P b) {return (b.y - a.y) / (b.x - a.x);} // 斜率
friend db angle(P a, P b) {return atan2(b.y - a.y, b.x - a.x); } // b -> a 的极角
friend db area(P a, P b, P c) {return fabs((c - a) * (b - a)) / 2;} // 三角形面积
bool operator <(const P &b) const {return sign(x - b.x) ? x < b.x: y < b.y;}
bool operator ==(const P &b) const {return sign(x - b.x) == 0 && sign(y - b.y) == 0;}
P turn(db t) { //顺时针旋转 t(theta)(弧度)
return P(x * cos(-t) + y * sin(t), x * sin(-t) + y * cos(t));
}
P Turn(P b, db t) {// 绕b点顺时针旋转 t(theta)(弧度)
P c = *this - b;
return c.turn(t) + b;
}
void in() {scanf("%lf %lf", &x, &y);}
void out() {printf("%.5lf %.5lf\n", x, y);} // 注意输出位数
} q[N]; // 注意q是用来存凸包的
int judge(P a, P b, P c) {return sign((b - a) * (c - a)) > 0;} // a,b,c严格逆时针(有序)
int L_have(P s, P t, P p) {return !sign((p - s) * (t - s));}//直线上有点p
int S_have(P s, P t, P p) {return !sign((p - s) * (t - s)) && sign(dot(p - s, p - t)) <= 0;} //线段上有点p
int PICP(P *a, int n, P p) { // Point In Convex Polygon. p是否在凸多边形a外 (0: 内. 1: 边界, 2: 外)
if(judge(a[1], p, a[2]) || judge(a[n], p, a[1])) return 2;
if(S_have(a[1], a[2], p) || S_have(a[1], a[n], p)) return 1;
int l = 2, r = n - 1, mid;
while(l < r) { // 以 a[1] 为极点, 看p的极角在哪条边中间
mid = (l + r + 1) >> 1;
if(judge(a[1], a[mid], p)) l = mid;
else r = mid - 1;
}
if(judge(a[l], p, a[l + 1])) return 2;
return S_have(a[l], a[l + 1], p);
}
int PIP(int *a, int n, P p) { // Point in Polygon. (点的顺序是逆/顺时针给出) (return 0: 内. 1: 边界, 2: 外)
// 回转数算法.
a[n + 1] = a[1];
FOR(i, n) if(S_have(a[i], a[i + 1], p)) return 1;
db sum = 0, l = angle(p, a[1]), r, d;
FOR(i, n) {
r = angle(p, a[i + 1]);
d = r - l;
if(d >= PI) d -= 2 * PI;
else if(d < -PI) d += 2 * PI;
sum += d;
}
// 内部 sum = 2PI, 外部 sum = 0. 这里简单以PI为分界线
return abs(sum) < PI ? 2: 0;
}
// #define Half // 半平面交时要求斜率的弧度
struct L { //Line: 线段(segment/ S), 射线(ray/ R), 直线(line/ L)
P s, t;
L(P s, P t):s(s), t(t){init();}
L(){}
void in() {s.in(); t.in(); init();}
#ifdef Half
ld k; // 只有半平面交时需要的极角
#endif
void init() {
#ifdef Half
k = angle(s, t);
#endif
}
#ifdef Half
bool operator <(L b) const {
return sign(b.k - k) ? k < b.k: b.judge(s);
}
#endif
db len() {return (t - s).len();} // 线段长度
int judge(P b) {return geo::judge(s, t, b);}// 是否在半开平面内(向量左侧)
db crossRatio(L b) {
if(sign((t - s) * (b.t - b.s)) == 0) return inf;
return ((b.s - s) * (b.t - b.s)) / ((t - s) * (b.t - b.s));
}
P R2P(db r) {return s + (t - s) * r;} // Ratio to Point
VT<P> operator &(L b) { //直线交点
db r = crossRatio(b);
if(r == inf) return {};
return {R2P(r)};
}
// * 平行或共线不算交
bool S_cross(L b, bool s = 0) { //线段是否有交. s:strict. s=1时, 交点不能是端点.
db x = crossRatio(b), y = b.crossRatio(*this);
return sign(x) >= s && sign(1 - x) >= s &&
sign(y) >= s && sign(1 - y) >= s;
}
db P2S(P p) { // 点p到线段的距离
if(s == t) return (s - p).len();
P x = p - s, y = p - t, z = t - s;
if(sign(dot(x, z)) < 0) return x.len();
if(sign(dot(y, z)) > 0) return y.len();
return fabs((x * z) / z.len()); // 点到直线距离
}
db P2L(P p) {// 点到直线距离
return 2 * area(s, t, p) / dis(s, t);
}
P Foot_point(P p) { //点到直线的垂足
P x = p - s, y = p - t, z = t - s;
db u = dot(x, z), v = -dot(y, z); //求投影
return s + z * (u / (u + v));
}
P Sym_point(P p) {//symmetry point 对称点
return Foot_point(p) * 2 - p;
}
};
struct Cir: P { // 圆
db r;
Cir(db x = 0, db y = 0, db r = 0):P(x, y), r(r){}
void out() {printf("%.1lf %.1lf %.5lf\n", x, y, r);}
db P2C(P b) { // Point to Circle
return max((db)0, dis(P(*this), b) - r);
}
P rotate(db theta) { // 圆上theta弧度对应位置
return P(x + cos(theta) * r, y + sin(theta) * r);
}
friend vector<L> out_tangent(Cir A, Cir B) { // 外公切线
db d = dis(A, B);
if(d <= abs(A.r - B.r)) return {}; // 内含
VT<L> res;
db theta = angle(A, B) + PI / 2, ang = asin((B.r - A.r) / d);
res.emplace_back(A.rotate(theta + ang), B.rotate(theta + ang)); // 左侧指向圆外
res.emplace_back(B.rotate(theta - ang - PI), A.rotate(theta - ang - PI));
return res;
}
friend vector<L> in_tangent(Cir A, Cir B) {
db d = dis(A, B);
if(!sign(d - A.r - B.r)) { // 外切
P p = A + (B - A) * (A.r / d);
return {L(p, p + normal(B - A))};
}
if(d < A.r + B.r) return {};
VT<L> res;
db theta = angle(A, B), ang = acos((B.r + A.r) / d);
res.emplace_back(A.rotate(theta - ang), B.rotate(theta - ang + PI));
res.emplace_back(A.rotate(theta + ang), B.rotate(theta + ang + PI));
return res;
}
};
int Convex_hull(P *a, int n, P *q) { // 输入a[1...n]. 返回凸包点数, 凸包顶点存到q(逆时针)
assert(n >= 0);
if(n <= 2) {
FOR(i, n) q[i] = a[i];
q[n + 1] = q[1];
return n;
}
sort(a + 1, a + n + 1);
int r = 0;
FOR(i, n) {//下凸壳
while(r > 1 && !judge(q[r - 1], q[r], a[i])) r--;
q[++r] = a[i];
}
int st = r;
REP(i, 1, n - 1) {//上凸壳
while(r > st && !judge(q[r - 1], q[r], a[i])) r--;
q[++r] = a[i];
}
return --r; // a[1]会存两遍, 所以要-1
}
db Max_dis(P *a, int n) { //旋转卡壳求最远点对
if(n < 2) return 0;
int m = Convex_hull(a, n, q);
db ans = dis(q[1], q[2]);
for(int i = 1, j = 2; i <= m; i++) {
P &x = q[i], &y = q[i + 1];
while(area(x, y, q[j]) < area(x, y, q[j + 1])) j = j % m + 1;
cmax(ans, (x - q[j]).len());
cmax(ans, (y - q[j]).len());
}
return ans;
}
bool cmp_x(P x, P y) {return x.x < y.x;}
bool cmp_y(P x, P y) {return x.y < y.y;}
db min_dis; void upd(const P &u, const P &v) {cmin(min_dis, dis(u, v)); }
void get_min(P *p, int l, int r) { // [l, r]
if(r - l <= 4) {
rep(i, l, r) rep(j, i + 1, r)
upd(p[i], p[j]);
return sort(p + l, p + r + 1, cmp_y);
}
int mid = (l + r) >> 1;
db midx = p[mid].x;
get_min(p, l, mid);
get_min(p, mid + 1, r);
inplace_merge(p + l, p + mid + 1, p + r + 1, cmp_y);
static P t[N];
int m = 0;
rep(i, l, r) {
auto now = p[i];
db dx = abs(now.x - midx);
if(dx < min_dis) {
for(int j = m; j > 0 && (now.y - t[j].y) <= min_dis; j--)
upd(now, t[j]);
t[++m] = now;
}
}
}
db Min_dis(P *a, int n) { // 最近点对距离
sort(a + 1, a + n + 1, cmp_x); // * Note: 会改变a数组
min_dis = inf; get_min(a, 1, n);
return min_dis;
}
db Min_matrix(P *a, int n) {//最小矩形覆盖
if(n <= 2) return 0;
int m = Convex_hull(a, n, q);
db ans = inf; P A, B, C, D;
int j = 2, l = 2, r = 2;
FOR(i, m) {
P v = q[i + 1] - q[i], S = q[i]; // 确定矩形一边所在直线
while(v * (q[j] - S) < v * (q[j + 1] - S)) j = j % m + 1; // 确定高度
while(dot(v, q[r + 1] - S) > dot(v, (q[r] - S))) r = r % m + 1;
if(i == 1) l = r;
while(dot(v, q[l + 1] - S) < dot(v, (q[l] - S))) l = l % m + 1;
if(cmin(ans, dot(v, q[r] - q[l]) * fabs((q[j] - S) * v) / dot(v, v))) {
v = v / v.len(); //单位化
P u = normal(v); //法向量
// A,B,C,D逆时针排列
A = v * dot(v, q[l] - S) + S;
B = v * dot(v, q[r] - S) + S;
db h = v * (q[j] - S);
C = B + u * h;
D = A + u * h;
}
}
printf("%.5lf\n", ans);
A.out(); B.out(); C.out(); D.out(); //四个顶点
return ans;
}
#ifdef Half
int Half_plane(L *a, int n, P *p) { //半平面交, 需要在前面 #define Half.
// a[1...n] 表示半平面, p为凸包上的点, 返回点数
sort(a + 1, a + n + 1);
int l = 1, r = 1;
rep(i, 2, n) if(a[i].k - a[r].k > eps) {
while(l < r && !a[i].judge(a[r - 1] & a[r])) r--;
while(l < r && !a[i].judge(a[l] & a[l + 1])) l++;
a[++r] = a[i];
//注意:这里的实现把a数组覆盖了, 如果不想修改a,要开个新的数组
}
while(l < r && !a[l].judge(a[r] & a[r - 1])) r--; // r已经删掉不需要的l了,现在l删r
n = 0;
if(r - l > 1) { // 如果有无解的情况,那么一开始要加上无穷大的边界(四个), 最后r - l <= 1 就是无解.
a[r + 1] = a[l];
rep(i, l, r) p[++n] = a[i] & a[i + 1];
}
return n;
}
#endif
int Mincowski(P *a, int n, P *b, int m, P *c) {//闵可夫斯基合并凸包(x∈A,y∈B,x+y∈C)
static P v1[N], v2[N];
int t = 1; c[t] = a[1] + b[1];
a[n + 1] = a[1]; b[m + 1] = b[1];
FOR(i, n) v1[i] = a[i + 1] - a[i];
FOR(i, m) v2[i] = b[i + 1] - b[i];
int i = 1, j = 1;
while(i <= n && j <= m) ++t, c[t] = c[t - 1] + (v1[i] * v2[j] > 0 ? v1[i++]: v2[j++]);
while(i <= n) ++t, c[t] = c[t - 1] + v1[i++];
while(j <= m) ++t, c[t] = c[t - 1] + v2[j++];
return t;
}
db Area(P *a, int n) { //求面积
db s = 0; a[n + 1] = a[1];
FOR(i, n) s += a[i] * a[i + 1];
return abs(s) / 2;
}
int n, m;
db vy, ans = inf;
L seg[N];
pii a[N]; P p[N];
db f[N];
bool check(L s, int u, int v) {
FOR(i, n)
if(i != u && i != v && s.S_cross(seg[i], 0))
return 0;
return 1;
}
bool valid[N];
void solve() {
qr(n, m, vy);
FOR(i, 2 * n) {
qr(a[i].fi, a[i].se);
p[i] = P(a[i]);
int x = a[i].fi, y = a[i].se;
if(i % 2 == 0) {
seg[i / 2] = L(p[i - 1], p[i]);
if(abs(a[i - 1].fi - a[i].fi) == 2 * m) {
return pr2(-1);
}
}
}
fill(f + 1, f + 2 * n + 1, inf);
using T = pair<db, int>;
priority_queue<T, VT<T>, greater<T>> q;
P s(0, -1e9), t(0, 1e9); // ! 源汇点
a[0] = {0, -1e5}; p[0] = P(a[0]);
f[0] = 0; q.push({0, 0}); valid[0] = 1;
FOR(i, 2 * n) {
valid[i] = a[i].fi != -m && a[i].fi != m;
if(valid[i] && check(L(s, p[i]), (i + 1) / 2, 0)) {
f[i] = 0;
q.push({0, i});
}
}
while(q.size()) {
auto [dis, x] = q.top(); q.pop();
if(sign(dis - f[x])) continue;
// debug(x); debug(dis);
if(check(L(p[x], t), (x + 1) / 2, 0)) {
// debug("end");
// debug(x);
cmin(ans, f[x]);
continue;
}
FOR(y, 2 * n) {
if(a[x].se >= a[y].se || !valid[y]) continue;
L seg(p[x], p[y]);
if(check(seg, (x + 1) / 2, (y + 1) / 2) && cmin(f[y], max(f[x], vy / fabs(slope(p[x], p[y]))))) {
// debug(slope(p[x], p[y]));
q.push({f[y], y});
}
}
}
if(ans == inf) pr2(-1);
else printf("%.15lf\n", ans);
}
}
int main() {
int T = 1;
// qr(T);
FOR(t, T) {
geo::solve();
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3984kb
input:
3 2 1 -2 0 1 0 -1 4 2 4 0 1 0 3
output:
1.000000000000000
result:
ok found '1.0000000', expected '1.0000000', error '0.0000000'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
2 1 2 -1 0 1 0 1 1 0 1
output:
-1
result:
ok found '-1.0000000', expected '-1.0000000', error '-0.0000000'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3824kb
input:
2 3 7 -3 0 2 2 3 1 -2 17
output:
1.866666666666667
result:
ok found '1.8666667', expected '1.8666667', error '0.0000000'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3984kb
input:
1 100 1 -100 0 99 0
output:
0.000000000000000
result:
ok found '0.0000000', expected '0.0000000', error '-0.0000000'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3920kb
input:
3 8 3 -8 -9 0 -9 -6 -6 6 6 8 9 0 9
output:
6.000000000000000
result:
ok found '6.0000000', expected '6.0000000', error '0.0000000'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3896kb
input:
3 8 3 -8 9 0 9 -6 6 6 -6 8 -9 0 -9
output:
6.000000000000000
result:
ok found '6.0000000', expected '6.0000000', error '0.0000000'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3972kb
input:
2 1 2 -1 0 0 0 1 1 0 1
output:
0.000000000000000
result:
ok found '0.0000000', expected '0.0000000', error '-0.0000000'
Test #8:
score: 0
Accepted
time: 0ms
memory: 4048kb
input:
3 9 10 -9 -26 0 -8 -6 -6 6 6 9 26 0 8
output:
30.000000000000000
result:
ok found '30.0000000', expected '30.0000000', error '0.0000000'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3896kb
input:
3 9 10 -9 26 0 8 -6 6 6 -6 9 -26 0 -8
output:
30.000000000000000
result:
ok found '30.0000000', expected '30.0000000', error '0.0000000'
Test #10:
score: 0
Accepted
time: 0ms
memory: 3852kb
input:
4 9 5 -9 -4 -3 0 -6 2 6 2 -6 -6 2 -8 -4 -12 9 -25
output:
7.500000000000000
result:
ok found '7.5000000', expected '7.5000000', error '0.0000000'
Test #11:
score: 0
Accepted
time: 0ms
memory: 3872kb
input:
100 10000 2 1663 -5179 1091 -542 -5687 -1048 7838 4346 3959 -2780 1099 -9402 -8661 -856 3945 7651 -1688 5290 -3518 2625 10000 -8028 5857 -9678 -9929 4601 -6350 3819 -1173 -9608 -2422 -9939 10000 -4668 5423 -2597 -572 -9335 -5787 -7658 -10000 1589 3117 9331 9818 4874 1345 1669 9026 -8243 2952 -6411 8...
output:
5.977607542722452
result:
ok found '5.9776075', expected '5.9776075', error '0.0000000'
Test #12:
score: 0
Accepted
time: 0ms
memory: 3924kb
input:
20 100 5 100 55 77 -18 60 -33 45 -1 41 41 -84 53 66 -77 30 -70 44 -15 -45 -98 -36 19 67 29 51 -71 89 -50 100 -48 92 -39 43 20 -22 -33 10 -71 7 -52 -100 -9 -4 13 -100 90 -19 81 73 67 6 54 -86 2 -91 67 59 -35 77 -55 -43 -40 -58 -41 100 82 -39 55 40 -17 39 -12 42 4 84 -52 61 78 -46 86
output:
27.000000000000000
result:
ok found '27.0000000', expected '27.0000000', error '0.0000000'
Test #13:
score: 0
Accepted
time: 0ms
memory: 3872kb
input:
20 100 1 90 -37 -90 90 -61 46 -83 42 26 -45 -89 -79 -100 -3 -51 -34 40 -57 22 -70 90 55 17 75 5 -50 -35 24 -1 -20 33 -19 -69 78 100 -13 -45 -52 -89 -15 100 -100 -3 -23 49 84 78 95 -48 43 -21 -23 100 53 78 84 65 -42 84 -61 100 23 100 19 -58 38 -48 18 26 -53 -51 -92 29 37 -81 90 -5 82 43 30
output:
1.318181818181818
result:
ok found '1.3181818', expected '1.3181818', error '0.0000000'
Test #14:
score: 0
Accepted
time: 2ms
memory: 3984kb
input:
100 10000 9 9893 -5 -4023 94 2920 -32 -2174 -97 7462 24 4169 40 -6157 -25 -6492 40 5908 -16 647 48 4128 -19 -5163 -5 4082 96 7645 37 -8896 29 -2485 59 165 1 -1634 59 7644 -64 6345 -96 -8569 46 -5850 72 -2219 -64 -5429 -13 641 -36 -3923 -25 -1947 6 -3957 43 8241 -6 -2456 77 5268 -95 890 -75 3296 78 -...
output:
3037.153846153846189
result:
ok found '3037.1538462', expected '3037.1538462', error '0.0000000'
Test #15:
score: 0
Accepted
time: 0ms
memory: 3972kb
input:
10 50 4 5 -45 22 -48 -50 20 -23 19 -43 -29 35 31 50 -33 40 48 -49 -32 0 -33 16 -50 21 -49 50 -38 -22 -18 -49 50 11 14 20 -23 16 -11 -27 -15 35 32
output:
3.354838709677419
result:
ok found '3.3548387', expected '3.3548387', error '0.0000000'
Test #16:
score: 0
Accepted
time: 0ms
memory: 3892kb
input:
10 50 1 -50 -3 28 -3 7 -30 2 -30 34 39 50 39 16 22 43 22 50 -32 7 -32 50 15 -2 15 -15 -42 24 -42 14 -26 28 -26 23 -10 -39 -10 50 -44 -31 -44
output:
1.666666666666667
result:
ok found '1.6666667', expected '1.6666667', error '0.0000000'
Test #17:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
10 50 2 35 10 7 22 -47 -23 -34 8 44 27 14 47 50 -13 -43 -48 44 -15 20 -12 -42 -34 11 -5 50 -5 -32 19 17 -39 46 -27 50 -2 11 20 -1 29 30 31
output:
0.000000000000000
result:
ok found '0.0000000', expected '0.0000000', error '-0.0000000'
Test #18:
score: 0
Accepted
time: 5ms
memory: 3852kb
input:
100 10000 10 0 9993 -10000 9997 -8432 1663 -4444 1091 -6362 3959 -103 1099 -6051 -8548 -5705 -3821 -1799 4343 -9251 8281 -10000 -1137 -6247 718 -10000 -1352 -641 -1609 -2741 -1688 -2924 -3518 -10000 5035 -7198 5857 -4181 -9929 -3009 -6350 -9568 -9578 -7653 -9810 -9208 2799 -8703 3189 -10000 -3228 -3...
output:
0.001500525183814
result:
ok found '0.0015005', expected '0.0015005', error '0.0000000'
Test #19:
score: 0
Accepted
time: 0ms
memory: 3772kb
input:
7 70 6 -63 -598 7 -598 70 260 14 104 35 26 -21 -182 -21 -286 -21 -494 -56 -208 -56 -572 -70 0 0 0 -42 -208 -14 -208
output:
1.615384615384615
result:
ok found '1.6153846', expected '1.6153846', error '0.0000000'
Test #20:
score: 0
Accepted
time: 0ms
memory: 4040kb
input:
1 10 1 -10 0 -10 10
output:
0.000000000000000
result:
ok found '0.0000000', expected '0.0000000', error '-0.0000000'
Test #21:
score: 0
Accepted
time: 0ms
memory: 3924kb
input:
2 3 1 2 0 2 3 -3 1 2 100
output:
0.000000000000000
result:
ok found '0.0000000', expected '0.0000000', error '-0.0000000'
Test #22:
score: 0
Accepted
time: 0ms
memory: 3568kb
input:
3 3 1 -3 -3 2 -1 0 -1 0 2 -2 2 3 5
output:
-1
result:
ok found '-1.0000000', expected '-1.0000000', error '-0.0000000'
Test #23:
score: 0
Accepted
time: 0ms
memory: 3972kb
input:
3 3 1 -3 -3 2 -1 0 0 0 2 -2 2 3 5
output:
2.000000000000000
result:
ok found '2.0000000', expected '2.0000000', error '0.0000000'
Test #24:
score: 0
Accepted
time: 0ms
memory: 3928kb
input:
5 3 1 -3 -3 0 0 0 -4 3 -4 0 1 0 2 0 -1 0 -2 0 -9 0 -1000
output:
0.000000000000000
result:
ok found '0.0000000', expected '0.0000000', error '-0.0000000'