# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
941300 |
2024-03-08T13:20:15 Z |
Kavelmydex |
Mobile (BOI12_mobile) |
C++17 |
|
1000 ms |
26552 KB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define pi pair<int,int>
#define vi vector<int>
#define rep(i,x,n) for(int i=x; i<n; ++i)
#define For(i,n) rep(i,0,n)
#define pb push_back
#define endl "\n"
#define sp ' '
#define f first
#define s second
#define sz size()
#define all(x) (x).begin(),(x).end()
const int N = 3e5+10, OO = 1e18, mod = 1e9+7;
void tr(int a, int b){cout << a << sp << b << endl;}
void cmx(int &a, int b){a = max(a,b);}
void cmn(int &a, int b){a = min(a,b);}
vector <pi> v;
int n,L;
bool cmp(const pi &a, const pi &b){
return (a.f==b.f ? abs(a.s) < abs(b.s): a.f < b.f);
}
bool ok(double m){
double mn = OO, mx = -OO, z = 0;
For(i,n){
auto [x,y] = v[i];
if(y*y > m*m) continue;
double d = sqrt(m * m - y * y);
if(x-d <= z){
z = max(z,x+d);
}
if(x-d < mn) mn = x-d;
if(mx < x+d) mx = x+d;
}
return (mn <= 0 && L <= mx && z >= L);
}
int32_t main() {
ios::sync_with_stdio(0); cin.tie(0);
cin >> n >> L;
For(i,n){
int x,y; cin >> x >> y;
v.pb({x,y});
}
sort(all(v),cmp);
double l = 0, r = 1e10;
For(i,100){
double m = (l+r)/2;
bool b = ok(m);
if(b) r = m;
else l = m;
}
cout << setprecision(10) << r << endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
460 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
456 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
348 KB |
Output is correct |
2 |
Correct |
3 ms |
464 KB |
Output is correct |
3 |
Correct |
2 ms |
348 KB |
Output is correct |
4 |
Correct |
3 ms |
596 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
604 KB |
Output is correct |
2 |
Correct |
5 ms |
604 KB |
Output is correct |
3 |
Correct |
4 ms |
596 KB |
Output is correct |
4 |
Correct |
4 ms |
604 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
720 KB |
Output is correct |
2 |
Correct |
7 ms |
604 KB |
Output is correct |
3 |
Correct |
4 ms |
464 KB |
Output is correct |
4 |
Correct |
3 ms |
724 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
600 KB |
Output is correct |
2 |
Correct |
5 ms |
860 KB |
Output is correct |
3 |
Correct |
4 ms |
708 KB |
Output is correct |
4 |
Correct |
4 ms |
604 KB |
Output is correct |
5 |
Correct |
4 ms |
608 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
77 ms |
3292 KB |
Output is correct |
2 |
Correct |
72 ms |
3284 KB |
Output is correct |
3 |
Correct |
43 ms |
2012 KB |
Output is correct |
4 |
Correct |
34 ms |
3548 KB |
Output is correct |
5 |
Correct |
25 ms |
2012 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
39 ms |
3292 KB |
Output is correct |
2 |
Correct |
34 ms |
3032 KB |
Output is correct |
3 |
Correct |
43 ms |
3288 KB |
Output is correct |
4 |
Correct |
36 ms |
3544 KB |
Output is correct |
5 |
Correct |
38 ms |
3540 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
83 ms |
3288 KB |
Output is correct |
2 |
Correct |
78 ms |
3284 KB |
Output is correct |
3 |
Correct |
70 ms |
3032 KB |
Output is correct |
4 |
Correct |
42 ms |
3544 KB |
Output is correct |
5 |
Correct |
52 ms |
3032 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
97 ms |
3544 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
97 ms |
3544 KB |
Output is correct |
2 |
Correct |
102 ms |
3540 KB |
Output is correct |
3 |
Correct |
81 ms |
3208 KB |
Output is correct |
4 |
Correct |
44 ms |
3540 KB |
Output is correct |
5 |
Correct |
53 ms |
3288 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
481 ms |
11188 KB |
Output is correct |
2 |
Incorrect |
501 ms |
12824 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
512 ms |
13592 KB |
Output is correct |
2 |
Correct |
620 ms |
12200 KB |
Output is correct |
3 |
Correct |
390 ms |
11564 KB |
Output is correct |
4 |
Correct |
211 ms |
13492 KB |
Output is correct |
5 |
Correct |
236 ms |
12440 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
594 ms |
19552 KB |
Output is correct |
2 |
Incorrect |
603 ms |
22848 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
596 ms |
22588 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
680 ms |
19800 KB |
Output is correct |
2 |
Incorrect |
683 ms |
22456 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
659 ms |
23304 KB |
Output is correct |
2 |
Correct |
747 ms |
22708 KB |
Output is correct |
3 |
Correct |
602 ms |
21176 KB |
Output is correct |
4 |
Correct |
303 ms |
23316 KB |
Output is correct |
5 |
Correct |
325 ms |
21172 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
798 ms |
21176 KB |
Output is correct |
2 |
Incorrect |
784 ms |
21716 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
774 ms |
21620 KB |
Output is correct |
2 |
Correct |
844 ms |
21440 KB |
Output is correct |
3 |
Correct |
642 ms |
23736 KB |
Output is correct |
4 |
Correct |
366 ms |
26552 KB |
Output is correct |
5 |
Correct |
377 ms |
24344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1010 ms |
21428 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
955 ms |
24816 KB |
Output is correct |
2 |
Execution timed out |
1004 ms |
22960 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |