QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#83280 | #5612. Picking Up Steam | jeroenodb | AC ✓ | 6ms | 3752kb | C++17 | 6.6kb | 2023-03-01 11:03:14 | 2023-03-01 11:03:15 |
Judging History
answer
#include "bits/stdc++.h"
using namespace std;
#define all(x) begin(x),end(x)
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }
template<typename T_container, typename T = typename enable_if<!is_same<T_container, string>::value, typename T_container::value_type>::type> ostream& operator<<(ostream &os, const T_container &v) { string sep; for (const T &x : v) os << sep << x, sep = " "; return os; }
#define debug(a) cerr << "(" << #a << ": " << a << ")\n";
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pi;
const int mxN = 1e5+1, oo = 1e9;
typedef long double lld;
typedef long double ld;
typedef complex<ld> pt;
#define X real()
#define Y imag()
auto cross(pt u, pt v) {return (ld)u.X*v.Y-(ld)u.Y*v.X;}
auto sgn(ld a) {return (a>0)-(a<0) ;}
bool isZero(pt p) {
return abs(p.X)+abs(p.Y)==0;
}
auto ccw(pt p1, pt p2, pt p3) {auto u = p2-p1, v = p3-p2;return cross(u,v);}
auto in(pt p1, pt p2) {return (ld)p1.X*p2.X+(ld)p1.Y*p2.Y;}
auto norm(pt p) {return (ld)p.X*p.X+(ld)p.Y*p.Y;}
bool comp(const pt& a, const pt& b) { return a.Y>b.Y or (a.Y==b.Y and a.X < b.X);}
void read(pt& p) {
int a,b; cin >> a >> b;
p = {ld(a),ld(b)};
}
bool segseg(pt p, pt q, pt a, pt b) { // strict segment segment intersection
return sgn(ccw(p,q,a))*sgn(ccw(p,q,b))==-1 and sgn(ccw(a,b,p))*sgn(ccw(a,b,q))==-1;
}
bool onRay(pt p, pt dir, pt a) { // strictly on ray
if(sgn(ccw(p,p+dir,a))!=0) return false;
return in(a-p,dir)>=0;
}
bool onSegment(pt p, pt q, pt c) {
if(sgn(ccw(p,q,c))!=0) return false;
auto v = c-p;
auto tmp = in(v,q-p);
return ld(0)<tmp and tmp<norm(q-p);
}
template<class P> pt lineInter(P s1, P e1, P s2, P e2) {
ld d = cross(e1 - s1,e2 - s2);
ld p = ccw(s2,e1, e2), q = ccw(s2,e2, s1);
return (s1 * p + e1 * q) / d;
}
ld segdist(pt l, pt r, pt a, pt b, pt dir) {
if(segseg(a,b,l,r)) {
return 0;
}
ld ans;
bool f=1;
for(int rep=0;rep<2;++rep) {
for(auto p : {l,r}) {
auto cur = min(norm(p-a),norm(p-b));
if(f==1) {
f=0;
ans=cur;
}
ans=min(ans,cur);
pt v = b-a, w = p-a;
if(in(v,w)>=0 and in(v,w)<=in(v,v)) {
if(rep==0) v=dir;
ans=min(ans,cross(v,w)*cross(v,w)/norm(v));
}
}
swap(l,a);
swap(r,b);
}
return ans;
}
ld segline(pt l, pt r, pt a, pt b) { // seg, line
if(sgn(ccw(a,b,l))*sgn(ccw(a,b,r))==-1) {
return 0;
}
ld ans;
bool f=1;
for(auto p : {l,r}) {
pt v = b-a, w = p-a;
auto cur = cross(v,w)*cross(v,w)/norm(v);
if(f==1) {
f=0;
ans=cur;
}
ans=min(ans,cur);
}
return ans;
}
int main() {
// intersection of circle and polygon = closest distance calculation + point in polygon
// use fractions?
// maybe becomes weird
// can use fractions of x/2000?
// yeah, that could be useful
// how big? pfooo, dat is moeilijk
// misschien toch python?
// just take fraction class
// then geometry and so on
// line inter is useful
// start met camera berekenen: lineinter
// dan links en rechts ga er overheen, als in gezichtsveld,
// cirkel + twee lijnen, checken of echt snijden
// een lijn: of gaat er helemaal doorheen, of zit er in.
// point in polygon
// of zit er strikt buiten --> geen enkele intersection.
// strict
// zijkanten "oneindig" hoog.
// oneinding = kwadratisch hoog
// segment distance
int n; cin >> n;
++n;
vector<pt> pts(n);
for(auto& p : pts) read(p);
int mid=-1;
{
int c;
cin >> c;
int i=0;
while(pts[i].X<c) ++i;
if(pts[i].X==c) {
mid=i;
} else {
pt ori = lineInter(pts[i-1],pts[i],pt{ld(c),ld(0)},pt{ld(c),ld(1)});
pts.insert(pts.begin()+i,ori);
mid=i;
}
if(ld(c)!=pts[0].X) pts.insert(pts.begin(),pts.front()+pt{ld(0),ld(5e3)}),++mid;
if(ld(c)!=pts.back().X) pts.push_back(pts.back()+pt{ld(0),ld(5e3)});
}
n = pts.size();
pt steams; read(steams);
int r; cin >> r;
pt steamdir; read(steamdir);
int v; cin >> v;
// ok en nu?
// maak die polygoon!
vector<pt> poly;
{
pt ori = pts[mid];
poly = {ori};
if(mid+1<n) {
pt dir = pts[mid+1]-ori;
for(int i=mid+1;i<n;++i) {
if(i==n-1 or ccw(ori,ori+dir,pts[i])>0) {
poly.push_back(lineInter(ori,ori+dir,pts[i-1],pts[i]));
if(i!=n-1) poly.push_back(pts[i]);
dir=pts[i]-ori;
}
}
}
if(mid) {
pt dir = pts[mid-1]-ori;
vector<pt> polyl;
for(int i=mid-1;i>=0;--i) {
if(i==0 or ccw(ori,ori+dir,pts[i])<0) {
polyl.push_back(lineInter(ori,ori+dir,pts[i],pts[i+1]));
if(i!=0) polyl.push_back(pts[i]);
dir=pts[i]-ori;
}
}
reverse(all(polyl));
poly.insert(poly.begin(),all(polyl));
}
}
n = poly.size();
// nu binary search?
// seconde*1000 1e8 steps?
double lo = 0.0005, hi = 1./v;
bool gd=0;
auto intersect = [&](double t) {
double len = t*v;
auto vlen = sqrtl(norm(steamdir));
len/= vlen;
// round to what?
// int prec = 1<<30;
ld flen = len;
pt s = steams;
pt e = s+ steamdir*flen;
ld dist2;
for(int i=0;i+1<n;++i) {
auto myd = segdist(poly[i],poly[i+1],s,e,steamdir);
if(i==0) {
dist2=myd;
} else dist2= min(dist2,myd);
}
if(dist2<ld(r*r)) return true;
return false;
};
bool bad=1;
for(int i=0;i+1<n;++i) {
auto myd = segline(poly[i],poly[i+1],steams,steams+steamdir);
if(myd<r*r) bad=0;
}
if(bad) {
cout << "-1\n";
exit(0);
}
while(!intersect(hi) and hi<2e9) {
hi*=2;
}
for(int rep=0;rep<60;++rep) {
double mid = (lo+hi)/2;
if(intersect(mid)) {
gd=1;
hi = mid;
} else lo = mid;
}
if(gd) {
cout << setprecision(15) << (lo+hi)*0.5 << '\n';
} else cout << "-1\n";
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 3708kb
input:
7 1 0 2 2 4 2 5 5 6 0 9 4 12 3 14 0 2 13 -1 1 -1 1 1
output:
8.89949493661166
result:
ok found '8.89949', expected '8.89900', error '0.00006'
Test #2:
score: 0
Accepted
time: 1ms
memory: 3592kb
input:
3 0 0 3 3 6 3 9 0 3 4 1 1 -1 1 1
output:
1.12132034355964
result:
ok found '1.12132', expected '1.12132', error '0.00000'
Test #3:
score: 0
Accepted
time: 2ms
memory: 3480kb
input:
3 0 0 3 3 6 3 9 0 4 4 1 1 -1 1 1
output:
1.41421356237309
result:
ok found '1.41421', expected '1.41421', error '0.00000'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
3 0 0 3 3 6 3 9 0 4 4 1 1 1 1 1
output:
1.41421356237309
result:
ok found '1.41421', expected '1.41421', error '0.00000'
Test #5:
score: 0
Accepted
time: 2ms
memory: 3708kb
input:
3 0 0 3 3 6 3 9 0 8 4 1 1 1 1 1
output:
1.82842712474619
result:
ok found '1.82843', expected '1.82843', error '0.00000'
Test #6:
score: 0
Accepted
time: 2ms
memory: 3708kb
input:
3 0 0 3 3 6 3 9 0 0 4 1 1 0 1 1
output:
1.58578643762691
result:
ok found '1.58579', expected '1.58579', error '0.00000'
Test #7:
score: 0
Accepted
time: 2ms
memory: 3340kb
input:
3 0 0 3 3 6 3 9 0 0 4 1 1 1 1 1
output:
-1
result:
ok found '-1.00000', expected '-1.00000', error '-0.00000'
Test #8:
score: 0
Accepted
time: 2ms
memory: 3564kb
input:
2 10 10 30 40 60 60 50 40 30 10 -1 1 1
output:
3.94409659654538
result:
ok found '3.94410', expected '3.94410', error '0.00000'
Test #9:
score: 0
Accepted
time: 1ms
memory: 3708kb
input:
5 0 80 40 0 60 60 100 0 120 40 160 60 0 140 20 20 -1 1 1
output:
7.20242017967271
result:
ok found '7.20242', expected '7.20242', error '0.00000'
Test #10:
score: 0
Accepted
time: 2ms
memory: 3560kb
input:
5 0 80 40 0 60 60 100 0 120 40 160 60 0 140 20 20 0 1 1
output:
7.6393202250021
result:
ok found '7.63932', expected '7.63932', error '0.00000'
Test #11:
score: 0
Accepted
time: 2ms
memory: 3568kb
input:
3 -4 4 -1 3 0 0 3 3 -4 2 0 1 -1 1 1
output:
2.0065727096195
result:
ok found '2.00657', expected '2.00657', error '0.00000'
Test #12:
score: 0
Accepted
time: 1ms
memory: 3532kb
input:
9 -12 5 -10 2 -8 7 -6 5 -5 2 -3 2 -2 3 -1 6 1 6 3 4 0 -8 3 1 1 1 1
output:
2.82842712474619
result:
ok found '2.82843', expected '2.82843', error '0.00000'
Test #13:
score: 0
Accepted
time: 2ms
memory: 3704kb
input:
9 -12 5 -10 2 -8 7 -6 5 -5 2 -3 2 -2 3 -1 6 1 6 3 4 -12 -8 3 1 1 1 1
output:
8.15143083881638
result:
ok found '8.15143', expected '8.15143', error '0.00000'
Test #14:
score: 0
Accepted
time: 2ms
memory: 3532kb
input:
8 -4956 0 -413 0 413 1239 1239 0 1652 826 2478 826 3404 1239 3717 1239 5000 0 413 -1239 -1652 413 2 1 1
output:
2770.48822412224
result:
ok found '2770.48822', expected '2770.48822', error '0.00000'
Test #15:
score: 0
Accepted
time: 1ms
memory: 3476kb
input:
2 0 3 3 0 6 3 1 3 -1 1 0 1 1
output:
0.0005
result:
ok found '0.00050', expected '0.00000', error '0.00050'
Test #16:
score: 0
Accepted
time: 0ms
memory: 3532kb
input:
20 1 11 4 1 5 14 6 8 8 8 9 1 12 14 14 12 17 8 21 6 25 1 27 8 29 4 35 5 37 16 38 17 39 16 45 9 47 4 48 11 49 2 6 21 -2 1 0 15 5
output:
4.71715728752538
result:
ok found '4.71716', expected '4.71716', error '0.00000'
Test #17:
score: 0
Accepted
time: 2ms
memory: 3532kb
input:
20 2 10 4 4 6 13 9 3 10 12 11 5 12 0 14 15 15 10 17 20 19 8 21 4 28 18 29 7 32 10 36 2 39 0 40 5 41 6 42 18 47 2 33 34 -11 4 -3 13 1
output:
15.353831138391
result:
ok found '15.35383', expected '15.35383', error '0.00000'
Test #18:
score: 0
Accepted
time: 2ms
memory: 3536kb
input:
33 -4858 1505 -4750 252 -4377 2301 -4299 1512 -4124 4848 -3928 551 -3650 1782 -3242 163 -3241 4713 -2817 1286 -2753 2708 -1859 4013 -991 2481 -837 2253 356 669 385 4947 558 336 841 4286 1041 91 1122 3030 1371 4183 1456 1266 1632 844 1802 4762 2340 4087 2353 2421 2696 1915 3294 220 4405 3012 4413 481...
output:
43.6180615052042
result:
ok found '43.61806', expected '43.61806', error '0.00000'
Test #19:
score: 0
Accepted
time: 2ms
memory: 3528kb
input:
20 0 11 4 18 5 0 9 5 10 17 12 2 13 0 16 11 18 3 19 5 21 3 25 19 31 2 32 6 34 13 35 9 37 20 42 0 45 12 46 14 47 4 38 9 -15 5 -1 15 3
output:
57.5750067658964
result:
ok found '57.57501', expected '57.57501', error '0.00000'
Test #20:
score: 0
Accepted
time: 1ms
memory: 3684kb
input:
20 0 7 1 8 5 18 10 10 12 7 13 8 15 0 16 1 17 7 19 11 25 13 26 2 27 2 29 4 37 14 38 6 40 12 42 17 43 15 44 6 47 3 41 4 -14 1 6 5 5
output:
8.36839494112837
result:
ok found '8.36839', expected '8.36839', error '0.00000'
Test #21:
score: 0
Accepted
time: 1ms
memory: 3560kb
input:
15 -4759 2812 -4596 3951 -4052 4157 -3244 779 -2591 4780 -1380 81 -839 3638 -757 1156 8 392 881 3169 1035 2070 1390 3818 1982 3218 2020 2830 2686 2080 3928 4241 1390 1388 -1229 398 439 4605 41
output:
100.14537745045
result:
ok found '100.14538', expected '100.14538', error '0.00000'
Test #22:
score: 0
Accepted
time: 2ms
memory: 3544kb
input:
100 2 144 10 36 12 238 14 286 17 461 19 257 20 174 25 6 32 96 38 199 52 451 59 304 61 372 64 17 65 426 70 432 76 40 77 253 79 382 82 164 84 408 94 208 99 386 102 434 103 482 104 428 111 95 112 192 114 381 117 285 124 259 130 289 131 402 133 462 136 10 138 367 147 500 150 365 153 145 156 267 157 299 ...
output:
34.4888004593001
result:
ok found '34.48880', expected '34.48880', error '0.00000'
Test #23:
score: 0
Accepted
time: 2ms
memory: 3372kb
input:
100 13 43 14 384 16 276 22 343 26 375 28 453 29 369 40 265 41 153 45 81 51 446 58 58 62 388 65 187 73 109 77 167 79 59 98 316 104 257 105 133 112 68 120 345 133 95 144 290 145 70 146 375 152 118 160 362 166 75 167 479 168 48 176 141 178 45 181 339 183 355 184 261 188 221 189 267 196 108 207 263 211 ...
output:
-1
result:
ok found '-1.00000', expected '-1.00000', error '-0.00000'
Test #24:
score: 0
Accepted
time: 2ms
memory: 3712kb
input:
100 2 193 6 307 13 193 21 160 26 80 29 116 30 136 35 398 40 228 41 161 59 180 61 120 64 310 65 285 69 268 73 261 74 79 78 30 84 135 85 85 94 485 98 195 105 143 108 50 114 129 120 30 131 247 139 223 143 147 144 431 148 1 150 452 151 443 163 461 164 25 168 210 173 339 174 41 175 224 179 211 189 112 19...
output:
92.5301107897975
result:
ok found '92.53011', expected '92.53011', error '0.00000'
Test #25:
score: 0
Accepted
time: 2ms
memory: 3536kb
input:
100 4 309 20 470 23 362 29 439 30 342 46 465 49 363 55 6 56 40 58 478 61 358 62 459 64 326 71 135 73 499 75 490 83 241 86 429 93 44 98 349 100 415 104 13 106 341 120 19 128 467 130 175 131 235 137 58 138 101 155 205 156 19 157 364 159 124 163 222 168 255 174 207 177 87 181 240 186 224 188 119 194 47...
output:
16.9862292916545
result:
ok found '16.98623', expected '16.98623', error '0.00000'
Test #26:
score: 0
Accepted
time: 1ms
memory: 3420kb
input:
171 -4951 4053 -4885 4474 -4850 3308 -4820 2830 -4798 2464 -4783 4657 -4759 1857 -4599 890 -4467 1174 -4461 1849 -4352 1814 -4261 1358 -4191 4986 -4149 2579 -4004 891 -3988 4057 -3944 4843 -3886 4375 -3710 818 -3644 877 -3546 4297 -3510 4384 -3331 4080 -3286 3168 -3271 940 -3267 3829 -3206 161 -3172...
output:
-1
result:
ok found '-1.00000', expected '-1.00000', error '-0.00000'
Test #27:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
439 -4990 2843 -4970 4753 -4935 1802 -4918 2606 -4900 2888 -4886 3403 -4870 1607 -4826 3029 -4813 2183 -4742 3075 -4712 3708 -4701 1752 -4599 3587 -4583 2542 -4537 134 -4529 1165 -4515 54 -4506 2457 -4489 661 -4478 2497 -4456 503 -4443 3259 -4376 3839 -4368 745 -4353 1067 -4345 939 -4299 4447 -4274 ...
output:
1.01063590906639
result:
ok found '1.01064', expected '1.01064', error '0.00000'
Test #28:
score: 0
Accepted
time: 4ms
memory: 3548kb
input:
199 -5000 1106 -4984 2688 -4978 1052 -4891 3232 -4885 3569 -4845 3316 -4769 2665 -4761 3787 -4715 4499 -4695 3669 -4684 504 -4663 301 -4653 2757 -4643 4988 -4636 659 -4497 2931 -4423 4876 -4384 4305 -4375 4182 -4369 1732 -4233 1650 -4134 1345 -4131 3428 -4116 1789 -4109 3889 -4103 802 -4065 562 -389...
output:
7420.58283667271
result:
ok found '7420.58284', expected '7420.58284', error '0.00000'
Test #29:
score: 0
Accepted
time: 2ms
memory: 3360kb
input:
329 -4967 2068 -4948 502 -4817 126 -4790 3333 -4762 571 -4717 347 -4679 617 -4677 750 -4660 3188 -4629 3658 -4621 3788 -4599 3306 -4441 3746 -4397 3152 -4300 2648 -4293 111 -4291 1800 -4286 1336 -4262 4102 -4256 378 -4189 4296 -4185 4939 -4184 171 -4168 603 -4164 3289 -4100 3971 -4061 2049 -4008 295...
output:
-1
result:
ok found '-1.00000', expected '-1.00000', error '-0.00000'
Test #30:
score: 0
Accepted
time: 2ms
memory: 3572kb
input:
602 -4981 4519 -4948 4604 -4919 4617 -4900 1297 -4896 2508 -4889 4316 -4862 2086 -4851 2284 -4800 3614 -4799 3395 -4767 258 -4750 4182 -4749 545 -4720 652 -4709 1101 -4702 2728 -4691 2729 -4690 674 -4687 194 -4608 2131 -4592 3030 -4584 2898 -4549 1033 -4533 3912 -4525 1943 -4508 1369 -4451 972 -4432...
output:
74.8972174572299
result:
ok found '74.89722', expected '74.89722', error '0.00000'
Test #31:
score: 0
Accepted
time: 2ms
memory: 3712kb
input:
208 -4929 2891 -4849 901 -4801 901 -4795 3319 -4662 2937 -4655 3294 -4606 4566 -4605 1114 -4583 3792 -4536 2579 -4506 1770 -4332 4485 -4327 2658 -4296 979 -4289 3652 -4245 1384 -4111 4184 -4110 3675 -4016 4437 -3990 4623 -3958 1514 -3921 2233 -3820 2119 -3757 692 -3739 1616 -3735 4228 -3723 4366 -36...
output:
152.975828387135
result:
ok found '152.97583', expected '152.97583', error '0.00000'
Test #32:
score: 0
Accepted
time: 2ms
memory: 3692kb
input:
2 -5000 0 0 5000 5000 0 0 0 -5000 5000 0 5000 1000
output:
2.92893218813452
result:
ok found '2.92893', expected '2.92893', error '0.00000'
Test #33:
score: 0
Accepted
time: 2ms
memory: 3528kb
input:
2 -5000 0 0 5000 5000 0 0 0 -5000 5000 -5000 1 1000
output:
4.90099990198
result:
ok found '4.90100', expected '4.90100', error '0.00000'
Test #34:
score: 0
Accepted
time: 3ms
memory: 3652kb
input:
1000 -5000 5000 -4990 10 -4980 4990 -4970 20 -4960 4980 -4950 30 -4940 4970 -4930 40 -4920 4960 -4910 50 -4900 4950 -4890 60 -4880 4940 -4870 70 -4860 4930 -4850 80 -4840 4920 -4830 90 -4820 4910 -4810 100 -4800 4900 -4790 110 -4780 4890 -4770 120 -4760 4880 -4750 130 -4740 4870 -4730 140 -4720 4860...
output:
1988028.99598495
result:
ok found '1988028.99598', expected '1988028.99598', error '0.00000'
Test #35:
score: 0
Accepted
time: 6ms
memory: 3608kb
input:
1000 -5000 5000 -4990 10 -4980 4990 -4970 20 -4960 4980 -4950 30 -4940 4970 -4930 40 -4920 4960 -4910 50 -4900 4950 -4890 60 -4880 4940 -4870 70 -4860 4930 -4850 80 -4840 4920 -4830 90 -4820 4910 -4810 100 -4800 4900 -4790 110 -4780 4890 -4770 120 -4760 4880 -4750 130 -4740 4870 -4730 140 -4720 4860...
output:
2495.39222079351
result:
ok found '2495.39222', expected '2495.39222', error '0.00000'
Test #36:
score: 0
Accepted
time: 1ms
memory: 3752kb
input:
1000 -5000 5000 -4990 10 -4980 4990 -4970 20 -4960 4980 -4950 30 -4940 4970 -4930 40 -4920 4960 -4910 50 -4900 4950 -4890 60 -4880 4940 -4870 70 -4860 4930 -4850 80 -4840 4920 -4830 90 -4820 4910 -4810 100 -4800 4900 -4790 110 -4780 4890 -4770 120 -4760 4880 -4750 130 -4740 4870 -4730 140 -4720 4860...
output:
2500
result:
ok found '2500.00000', expected '2500.00000', error '0.00000'
Test #37:
score: 0
Accepted
time: 2ms
memory: 3528kb
input:
2 -5000 0 0 5000 5000 0 0 -4999 -2 1 -1 1 1
output:
1.41421356237309
result:
ok found '1.41421', expected '1.41421', error '0.00000'
Test #38:
score: 0
Accepted
time: 2ms
memory: 3560kb
input:
2 -5000 0 0 5000 5000 0 0 4999 -2 1 1 1 1
output:
1.41421356237309
result:
ok found '1.41421', expected '1.41421', error '0.00000'
Test #39:
score: 0
Accepted
time: 2ms
memory: 3564kb
input:
2 -5000 0 -4999 5000 -4998 0 -4999 -4999 -2 1 -1 1 1
output:
1.41421356237309
result:
ok found '1.41421', expected '1.41421', error '0.00000'
Test #40:
score: 0
Accepted
time: 1ms
memory: 3560kb
input:
2 -5000 0 -4999 5000 -4998 0 -4999 -4999 -2 1 1 1 1
output:
1.41421356237309
result:
ok found '1.41421', expected '1.41421', error '0.00000'
Test #41:
score: 0
Accepted
time: 2ms
memory: 3648kb
input:
2 -5000 0 0 1 5000 0 -2500 0 -5000 5000 0 1 1000
output:
0.000999900000001
result:
ok found '0.00100', expected '0.00100', error '0.00000'
Test #42:
score: 0
Accepted
time: 1ms
memory: 3652kb
input:
2 -5000 4999 0 5000 5000 4999 2500 0 -5000 1 0 1 1
output:
9998.99999998
result:
ok found '9999.00000', expected '9999.00000', error '0.00000'
Test #43:
score: 0
Accepted
time: 1ms
memory: 3520kb
input:
500 -5000 0 -4980 5000 -4960 20 -4940 4980 -4920 40 -4900 4960 -4880 60 -4860 4940 -4840 80 -4820 4920 -4800 100 -4780 4900 -4760 120 -4740 4880 -4720 140 -4700 4860 -4680 160 -4660 4840 -4640 180 -4620 4820 -4600 200 -4580 4800 -4560 220 -4540 4780 -4520 240 -4500 4760 -4480 260 -4460 4740 -4440 28...
output:
3535.81125603598
result:
ok found '3535.81126', expected '3535.81126', error '0.00000'
Test #44:
score: 0
Accepted
time: 2ms
memory: 3352kb
input:
21 0 0 1 2 2 1 3 4 4 1 5 5 6 4 7 9 11 8 14 7 16 6 17 5 18 3 21 4 23 5 24 6 25 8 26 9 28 9 29 10 32 10 33 11 0 10 1 4 43 11 79
output:
-1
result:
ok found '-1.00000', expected '-1.00000', error '-0.00000'
Test #45:
score: 0
Accepted
time: 2ms
memory: 3564kb
input:
21 0 0 1 2 2 1 3 4 4 1 5 5 6 4 7 9 11 8 14 7 16 6 17 5 18 3 21 4 23 5 24 6 25 8 26 9 28 9 29 10 32 10 33 11 0 10 1 4 -43 11 79
output:
0.0582435461280122
result:
ok found '0.05824', expected '0.05824', error '0.00000'
Test #46:
score: 0
Accepted
time: 0ms
memory: 3696kb
input:
21 0 0 1 2 2 1 3 4 4 1 5 5 6 4 7 9 11 8 14 7 16 6 17 5 18 3 21 4 23 5 24 6 25 8 26 9 28 9 29 10 32 10 33 11 8 10 1 4 43 11 79
output:
0.0807718391310666
result:
ok found '0.08077', expected '0.08077', error '0.00000'
Test #47:
score: 0
Accepted
time: 2ms
memory: 3340kb
input:
21 0 0 1 2 2 1 3 4 4 1 5 5 6 4 7 9 11 8 14 7 16 6 17 5 18 3 21 4 23 5 24 6 25 8 26 9 28 9 29 10 32 10 33 11 8 10 1 4 -43 11 79
output:
-1
result:
ok found '-1.00000', expected '-1.00000', error '-0.00000'
Test #48:
score: 0
Accepted
time: 1ms
memory: 3692kb
input:
21 0 0 1 2 2 1 3 4 4 1 5 5 6 4 7 9 11 8 14 7 16 6 17 5 18 3 21 4 23 5 24 6 25 8 26 9 28 9 29 10 32 10 33 11 11 10 1 4 43 11 79
output:
0.0691266240884155
result:
ok found '0.06913', expected '0.06913', error '0.00000'
Test #49:
score: 0
Accepted
time: 2ms
memory: 3528kb
input:
21 0 0 1 2 2 1 3 4 4 1 5 5 6 4 7 9 11 8 14 7 16 6 17 5 18 3 21 4 23 5 24 6 25 8 26 9 28 9 29 10 32 10 33 11 18 10 1 4 -11 43 79
output:
0.242275836007603
result:
ok found '0.24228', expected '0.24228', error '0.00000'
Test #50:
score: 0
Accepted
time: 1ms
memory: 3652kb
input:
21 0 0 1 2 2 1 3 4 4 1 5 5 6 4 7 9 11 8 14 7 16 6 17 5 18 3 21 4 23 5 24 6 25 8 26 9 28 9 29 10 32 10 33 11 33 10 1 4 -11 43 79
output:
0.0436468944372845
result:
ok found '0.04365', expected '0.04365', error '0.00000'
Test #51:
score: 0
Accepted
time: 0ms
memory: 3568kb
input:
2 -5000 1 -4999 0 4999 2 -5000 -4999 -1 1 4999 1 1
output:
0.0005
result:
ok found '0.00050', expected '0.00000', error '0.00050'
Test #52:
score: 0
Accepted
time: 2ms
memory: 3684kb
input:
2 -5000 0 -4999 5000 5000 0 -5000 5000 -1 1 0 5000 1
output:
49995000.9999
result:
ok found '49995000.99990', expected '49999999.00000', error '0.00010'
Test #53:
score: 0
Accepted
time: 2ms
memory: 3688kb
input:
2 -5000 0 4999 5000 5000 0 5000 -5000 -1 1 0 1 1
output:
49995000.9999
result:
ok found '49995000.99990', expected '49999999.00000', error '0.00010'