# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
916411 |
2024-01-25T20:01:03 Z |
codefox |
Mobile (BOI12_mobile) |
C++14 |
|
488 ms |
35160 KB |
#include<bits/stdc++.h>
using namespace std;
#define double long double
#define ll long long
#define pii pair<ll, ll>
#define pdd pair<double, double>
double prec = 1e6;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
cout << setprecision(20);
int n, l;
cin >> n >> l;
vector<pii> stations(n);
for (int i = 0; i < n; i++)
{
int a, b;
cin >> a >> b;
stations[i] = {a, b};
}
double dist = 0;
ll one = 1;
for (int i = 60; i >= 0; i--)
{
dist += (one<<i)/prec;
double highest = 0;
for (pii ele:stations)
{
double dy = ele.second*ele.second;
double diff = dist*dist-dy;
if (diff <= 0) continue;
double dx = sqrt(diff);
double f = ele.first-dx;
double s = ele.first+dx;
if (f < highest) highest = max(highest, s);
}
if (highest < l) continue;
dist -= (one<<i)/prec;
}
cout << dist << "\n";
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
2 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
604 KB |
Output is correct |
2 |
Correct |
2 ms |
344 KB |
Output is correct |
3 |
Correct |
2 ms |
348 KB |
Output is correct |
4 |
Correct |
2 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
348 KB |
Output is correct |
2 |
Correct |
2 ms |
348 KB |
Output is correct |
3 |
Correct |
2 ms |
348 KB |
Output is correct |
4 |
Correct |
2 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
348 KB |
Output is correct |
2 |
Correct |
2 ms |
348 KB |
Output is correct |
3 |
Correct |
2 ms |
348 KB |
Output is correct |
4 |
Correct |
2 ms |
348 KB |
Output is correct |
5 |
Correct |
2 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
36 ms |
1628 KB |
Output is correct |
2 |
Correct |
30 ms |
1624 KB |
Output is correct |
3 |
Correct |
19 ms |
1116 KB |
Output is correct |
4 |
Correct |
24 ms |
1628 KB |
Output is correct |
5 |
Correct |
15 ms |
1116 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
24 ms |
1628 KB |
Output is correct |
2 |
Correct |
22 ms |
1372 KB |
Output is correct |
3 |
Correct |
28 ms |
1628 KB |
Output is correct |
4 |
Correct |
26 ms |
1624 KB |
Output is correct |
5 |
Correct |
28 ms |
1628 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
33 ms |
1624 KB |
Output is correct |
2 |
Correct |
31 ms |
1624 KB |
Output is correct |
3 |
Correct |
29 ms |
1628 KB |
Output is correct |
4 |
Correct |
31 ms |
1884 KB |
Output is correct |
5 |
Correct |
28 ms |
1628 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
40 ms |
1880 KB |
Output is correct |
2 |
Correct |
38 ms |
1880 KB |
Output is correct |
3 |
Correct |
34 ms |
1884 KB |
Output is correct |
4 |
Correct |
32 ms |
1884 KB |
Output is correct |
5 |
Correct |
38 ms |
1884 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
41 ms |
2136 KB |
Output is correct |
2 |
Correct |
43 ms |
1880 KB |
Output is correct |
3 |
Correct |
34 ms |
1880 KB |
Output is correct |
4 |
Correct |
31 ms |
2028 KB |
Output is correct |
5 |
Correct |
31 ms |
1884 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
193 ms |
8284 KB |
Output is correct |
2 |
Correct |
191 ms |
8284 KB |
Output is correct |
3 |
Correct |
190 ms |
8284 KB |
Output is correct |
4 |
Correct |
150 ms |
8536 KB |
Output is correct |
5 |
Correct |
153 ms |
8284 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
193 ms |
8280 KB |
Output is correct |
2 |
Correct |
277 ms |
8284 KB |
Output is correct |
3 |
Correct |
165 ms |
8284 KB |
Output is correct |
4 |
Correct |
155 ms |
8480 KB |
Output is correct |
5 |
Correct |
150 ms |
8280 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
225 ms |
9816 KB |
Output is correct |
2 |
Correct |
239 ms |
19028 KB |
Output is correct |
3 |
Correct |
233 ms |
18540 KB |
Output is correct |
4 |
Correct |
186 ms |
21584 KB |
Output is correct |
5 |
Correct |
185 ms |
17648 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
243 ms |
9820 KB |
Output is correct |
2 |
Correct |
325 ms |
13904 KB |
Output is correct |
3 |
Correct |
205 ms |
13168 KB |
Output is correct |
4 |
Correct |
182 ms |
15724 KB |
Output is correct |
5 |
Correct |
181 ms |
14304 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
268 ms |
11352 KB |
Output is correct |
2 |
Correct |
273 ms |
17024 KB |
Output is correct |
3 |
Correct |
266 ms |
16724 KB |
Output is correct |
4 |
Correct |
215 ms |
18172 KB |
Output is correct |
5 |
Correct |
215 ms |
16212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
264 ms |
11356 KB |
Output is correct |
2 |
Correct |
360 ms |
16208 KB |
Output is correct |
3 |
Correct |
236 ms |
15700 KB |
Output is correct |
4 |
Correct |
225 ms |
18516 KB |
Output is correct |
5 |
Correct |
213 ms |
16652 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
299 ms |
12888 KB |
Output is correct |
2 |
Correct |
304 ms |
25264 KB |
Output is correct |
3 |
Correct |
313 ms |
24484 KB |
Output is correct |
4 |
Correct |
246 ms |
28584 KB |
Output is correct |
5 |
Correct |
245 ms |
23896 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
312 ms |
12888 KB |
Output is correct |
2 |
Correct |
393 ms |
18588 KB |
Output is correct |
3 |
Correct |
282 ms |
17964 KB |
Output is correct |
4 |
Correct |
245 ms |
20780 KB |
Output is correct |
5 |
Correct |
266 ms |
19100 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
372 ms |
15960 KB |
Output is correct |
2 |
Correct |
399 ms |
31480 KB |
Output is correct |
3 |
Correct |
381 ms |
30444 KB |
Output is correct |
4 |
Correct |
341 ms |
35160 KB |
Output is correct |
5 |
Correct |
332 ms |
29680 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
382 ms |
25316 KB |
Output is correct |
2 |
Correct |
488 ms |
26296 KB |
Output is correct |
3 |
Correct |
375 ms |
25428 KB |
Output is correct |
4 |
Correct |
325 ms |
30940 KB |
Output is correct |
5 |
Correct |
321 ms |
27608 KB |
Output is correct |