# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1098714 |
2024-10-09T19:05:13 Z |
sano |
Mobile (BOI12_mobile) |
C++14 |
|
903 ms |
23684 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<int, int>
#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() {
double n, asd;
cin >> n >> asd;
vec<pii> p;
For(i, n) {
double x, y;
cin >> x >> y;
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 });
}
double l = 0;
double r = 1414213570;
while ((r - l) > (0.001)) {
double mid = (l + r) / 2;
double k = 0;
For(i, p.size()) {
double d = sqrt(mid * mid - p[i].ss * p[i].ss);
double s = p[i].ff - d;
double e = p[i].ff + d;
if (s > k) continue;
k = max(k, e);
}
if (k >= asd) r = mid;
else l = mid;
}
cout << fixed << setprecision(3);
cout << l << '\n';
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 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 |
0 ms |
344 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 |
Incorrect |
2 ms |
348 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
348 KB |
Output is correct |
2 |
Correct |
4 ms |
604 KB |
Output is correct |
3 |
Correct |
2 ms |
476 KB |
Output is correct |
4 |
Incorrect |
4 ms |
600 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
348 KB |
Output is correct |
2 |
Correct |
4 ms |
456 KB |
Output is correct |
3 |
Correct |
3 ms |
344 KB |
Output is correct |
4 |
Incorrect |
4 ms |
604 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
348 KB |
Output is correct |
2 |
Correct |
4 ms |
600 KB |
Output is correct |
3 |
Correct |
2 ms |
484 KB |
Output is correct |
4 |
Incorrect |
4 ms |
604 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
51 ms |
1484 KB |
Output is correct |
2 |
Incorrect |
56 ms |
1992 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
41 ms |
496 KB |
Output is correct |
2 |
Correct |
47 ms |
1752 KB |
Output is correct |
3 |
Incorrect |
68 ms |
2432 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
48 ms |
1388 KB |
Output is correct |
2 |
Incorrect |
54 ms |
1992 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
67 ms |
1048 KB |
Output is correct |
2 |
Incorrect |
63 ms |
2256 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
77 ms |
1480 KB |
Output is correct |
2 |
Incorrect |
64 ms |
2172 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
284 ms |
5060 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
339 ms |
440 KB |
Output is correct |
2 |
Correct |
409 ms |
10932 KB |
Output is correct |
3 |
Incorrect |
269 ms |
6852 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
333 ms |
10420 KB |
Output is correct |
2 |
Correct |
377 ms |
9772 KB |
Output is correct |
3 |
Incorrect |
345 ms |
9044 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
386 ms |
516 KB |
Output is correct |
2 |
Correct |
498 ms |
16252 KB |
Output is correct |
3 |
Incorrect |
294 ms |
8308 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
375 ms |
9908 KB |
Output is correct |
2 |
Correct |
405 ms |
11348 KB |
Output is correct |
3 |
Correct |
381 ms |
10516 KB |
Output is correct |
4 |
Incorrect |
732 ms |
20268 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
451 ms |
516 KB |
Output is correct |
2 |
Correct |
566 ms |
17456 KB |
Output is correct |
3 |
Incorrect |
392 ms |
9660 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
455 ms |
9400 KB |
Output is correct |
2 |
Correct |
487 ms |
12832 KB |
Output is correct |
3 |
Correct |
482 ms |
12036 KB |
Output is correct |
4 |
Incorrect |
840 ms |
23684 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
487 ms |
416 KB |
Output is correct |
2 |
Correct |
631 ms |
17412 KB |
Output is correct |
3 |
Incorrect |
419 ms |
10944 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
556 ms |
9900 KB |
Output is correct |
2 |
Correct |
615 ms |
16012 KB |
Output is correct |
3 |
Incorrect |
603 ms |
15012 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
669 ms |
460 KB |
Output is correct |
2 |
Correct |
903 ms |
21340 KB |
Output is correct |
3 |
Incorrect |
584 ms |
13944 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |