# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1098727 |
2024-10-09T19:30:35 Z |
sano |
Mobile (BOI12_mobile) |
C++14 |
|
1000 ms |
51504 KB |
#include<iostream>
#include<vector>
#include<queue>
#include<deque>
#include<string>
#include<fstream>
#include<algorithm>
#include <iomanip>
#include<map>
#include <set>
#include <unordered_map>
#include <stack>
#include <unordered_set>
#include <cmath>
#define ll long long
#define For(i, n) for(int i = 0; i < (int)n; i++)
#define ffor(i, a, n) for(int i = (int)a; i < (int)n; i++)
#define rfor(i, n) for(int i = (int)n; i >= (int)0; i--)
#define rffor(i, a, n) for(int i = (int)n; i >= (int)a; i--)
#define vec vector
#define ff first
#define ss second
#define pb push_back
#define shit short int
#define pii pair<long double, long double>
#define NEK 2147483640
#define mod 1000000007
#define mod2 1000000009
#define rsz resize
#define prv1 43
#define prv2 47
#define D 8
using namespace std;
int main() {
long double n, asd;
cin >> n >> asd;
vec<pii> p;
For(i, n) {
long double x, y;
cin >> x >> y;
x *= 100000; y *= 100000;
if (p.size() > 0) {
if (x == p.back().ff && y > 0 && p.back().ss > 0) continue;
if (x == p.back().ff && y < 0) p.pop_back();
}
p.push_back({ x, y });
}
ll l = 0;
ll r = 141421357000000;
asd *= 100000;
while (l < r) {
long double mid = (l + r) / 2;
long double k = 0;
For(i, p.size()) {
long double jeden = mid * mid;
long double dva = p[i].second * p[i].second;
long double tri = jeden - dva;
long double d = sqrt(tri);
long double s = p[i].ff - d;
long double e = p[i].ff + d;
if (s > k) continue;
k = max(k, e);
}
if (k >= asd) r = mid;
else l = mid + 1;
}
cout << fixed << setprecision(5);
long double l2 = l;
l2 /= 100000;
cout << l2 << '\n';
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
436 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 |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
344 KB |
Output is correct |
4 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
348 KB |
Output is correct |
2 |
Correct |
3 ms |
604 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
3 ms |
604 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
604 KB |
Output is correct |
2 |
Correct |
4 ms |
860 KB |
Output is correct |
3 |
Correct |
3 ms |
348 KB |
Output is correct |
4 |
Correct |
8 ms |
860 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
604 KB |
Output is correct |
2 |
Correct |
4 ms |
860 KB |
Output is correct |
3 |
Correct |
3 ms |
348 KB |
Output is correct |
4 |
Correct |
10 ms |
860 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
860 KB |
Output is correct |
2 |
Correct |
5 ms |
860 KB |
Output is correct |
3 |
Correct |
3 ms |
348 KB |
Output is correct |
4 |
Correct |
9 ms |
860 KB |
Output is correct |
5 |
Correct |
3 ms |
516 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
86 ms |
5368 KB |
Output is correct |
2 |
Correct |
55 ms |
3280 KB |
Output is correct |
3 |
Correct |
48 ms |
3024 KB |
Output is correct |
4 |
Correct |
121 ms |
5840 KB |
Output is correct |
5 |
Correct |
21 ms |
812 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
42 ms |
1740 KB |
Output is correct |
2 |
Correct |
74 ms |
3280 KB |
Output is correct |
3 |
Correct |
116 ms |
5660 KB |
Output is correct |
4 |
Correct |
118 ms |
5568 KB |
Output is correct |
5 |
Correct |
136 ms |
5828 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
60 ms |
5312 KB |
Output is correct |
2 |
Correct |
70 ms |
3572 KB |
Output is correct |
3 |
Correct |
77 ms |
5568 KB |
Output is correct |
4 |
Correct |
171 ms |
6080 KB |
Output is correct |
5 |
Correct |
67 ms |
2248 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
71 ms |
3916 KB |
Output is correct |
2 |
Correct |
75 ms |
3816 KB |
Output is correct |
3 |
Correct |
55 ms |
2052 KB |
Output is correct |
4 |
Correct |
172 ms |
6028 KB |
Output is correct |
5 |
Correct |
131 ms |
5564 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
95 ms |
5692 KB |
Output is correct |
2 |
Correct |
67 ms |
3784 KB |
Output is correct |
3 |
Correct |
53 ms |
1996 KB |
Output is correct |
4 |
Correct |
179 ms |
6152 KB |
Output is correct |
5 |
Correct |
136 ms |
5564 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
395 ms |
20376 KB |
Output is correct |
2 |
Correct |
297 ms |
8464 KB |
Output is correct |
3 |
Correct |
284 ms |
7884 KB |
Output is correct |
4 |
Correct |
901 ms |
25748 KB |
Output is correct |
5 |
Correct |
631 ms |
21488 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
308 ms |
8912 KB |
Output is correct |
2 |
Correct |
631 ms |
22420 KB |
Output is correct |
3 |
Correct |
317 ms |
9140 KB |
Output is correct |
4 |
Correct |
833 ms |
25440 KB |
Output is correct |
5 |
Correct |
754 ms |
22688 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
461 ms |
37876 KB |
Output is correct |
2 |
Correct |
381 ms |
9928 KB |
Output is correct |
3 |
Correct |
343 ms |
9420 KB |
Output is correct |
4 |
Execution timed out |
1080 ms |
43948 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
382 ms |
10636 KB |
Output is correct |
2 |
Correct |
847 ms |
40344 KB |
Output is correct |
3 |
Correct |
326 ms |
11452 KB |
Output is correct |
4 |
Execution timed out |
1026 ms |
43756 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
490 ms |
37936 KB |
Output is correct |
2 |
Correct |
437 ms |
11468 KB |
Output is correct |
3 |
Correct |
406 ms |
10700 KB |
Output is correct |
4 |
Execution timed out |
1069 ms |
43628 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
445 ms |
12236 KB |
Output is correct |
2 |
Correct |
964 ms |
40436 KB |
Output is correct |
3 |
Correct |
417 ms |
12880 KB |
Output is correct |
4 |
Execution timed out |
1064 ms |
43416 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
605 ms |
38032 KB |
Output is correct |
2 |
Correct |
465 ms |
12956 KB |
Output is correct |
3 |
Correct |
447 ms |
12240 KB |
Output is correct |
4 |
Execution timed out |
1043 ms |
43668 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
516 ms |
13772 KB |
Output is correct |
2 |
Execution timed out |
1068 ms |
40468 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
768 ms |
40324 KB |
Output is correct |
2 |
Correct |
631 ms |
16080 KB |
Output is correct |
3 |
Correct |
583 ms |
15308 KB |
Output is correct |
4 |
Execution timed out |
1058 ms |
51504 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
652 ms |
17032 KB |
Output is correct |
2 |
Execution timed out |
1022 ms |
44288 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |