# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
976796 |
2024-05-07T06:37:36 Z |
Br3ad |
Mobile (BOI12_mobile) |
C++17 |
|
620 ms |
35944 KB |
#include <iostream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <cstring>
#include <string>
#include <cmath>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
using namespace std;
#define ll long long
#define ull unsigned long long
#define f first
#define s second
#define PF push_front
#define PB push_back
#define MP make_pair
#define max(a, b) ((a > b)? a : b)
#define min(a, b) ((a < b)? a : b)
#define max3(a, b, c) max(max(a, b), c)
#define min3(a, b, c) min(min(a, b), c)
const int N = 1e5 + 5;
const int M = 1e9 + 7;
const int inf = 0x3f3f3f3f;
const ll int INF = 1e18;
double bin(double l, double r, function<bool(double)> f){
while(r - l > 1e-3){
double mid = (r + l)/2;
if(f(mid)){
r = mid;
}else {
l = mid;
}
}
return l;
}
int main(){
ios::sync_with_stdio(false);
cin.tie(NULL);
// ifstream cin();
// ofstream cout();
vector<pair<double, double>> v;
int n;
double L;
cin >> n >> L;
for(int i = 0; i < n; i++){
double x, y;
cin >> x >> y;
v.PB(MP(x, y));
}
double ans = bin(1, 1e9, [&](double d){
double cur = 0;
for(int i = 0; i < n; i++){
double dis = sqrt(d*d - v[i].s * v[i].s);
double left = v[i].f - dis, right = v[i].f + dis;
if(left <= cur) cur = max(cur, right);
}
return (cur >= L);
});
cout << fixed << setprecision(3);
cout << ans << endl;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
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 |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
344 KB |
Output is correct |
2 |
Correct |
1 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 |
3 ms |
604 KB |
Output is correct |
2 |
Correct |
3 ms |
604 KB |
Output is correct |
3 |
Correct |
2 ms |
604 KB |
Output is correct |
4 |
Correct |
3 ms |
604 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
604 KB |
Output is correct |
2 |
Correct |
3 ms |
668 KB |
Output is correct |
3 |
Correct |
3 ms |
604 KB |
Output is correct |
4 |
Correct |
3 ms |
604 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
604 KB |
Output is correct |
2 |
Correct |
3 ms |
604 KB |
Output is correct |
3 |
Correct |
2 ms |
604 KB |
Output is correct |
4 |
Correct |
4 ms |
604 KB |
Output is correct |
5 |
Correct |
3 ms |
604 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
39 ms |
2520 KB |
Output is correct |
2 |
Correct |
36 ms |
2520 KB |
Output is correct |
3 |
Correct |
24 ms |
1496 KB |
Output is correct |
4 |
Correct |
40 ms |
2508 KB |
Output is correct |
5 |
Correct |
22 ms |
1500 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
36 ms |
2580 KB |
Output is correct |
2 |
Incorrect |
35 ms |
3288 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
36 ms |
2512 KB |
Output is correct |
2 |
Incorrect |
45 ms |
2516 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
47 ms |
2508 KB |
Output is correct |
2 |
Correct |
46 ms |
2520 KB |
Output is correct |
3 |
Correct |
43 ms |
2532 KB |
Output is correct |
4 |
Correct |
58 ms |
3588 KB |
Output is correct |
5 |
Correct |
49 ms |
2516 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
50 ms |
2456 KB |
Output is correct |
2 |
Correct |
45 ms |
2516 KB |
Output is correct |
3 |
Correct |
45 ms |
2512 KB |
Output is correct |
4 |
Correct |
61 ms |
4096 KB |
Output is correct |
5 |
Correct |
57 ms |
3592 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
207 ms |
9988 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
238 ms |
10432 KB |
Output is correct |
2 |
Correct |
280 ms |
10428 KB |
Output is correct |
3 |
Correct |
247 ms |
9452 KB |
Output is correct |
4 |
Correct |
273 ms |
9408 KB |
Output is correct |
5 |
Correct |
285 ms |
9560 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
242 ms |
18916 KB |
Output is correct |
2 |
Correct |
279 ms |
17768 KB |
Output is correct |
3 |
Correct |
272 ms |
18616 KB |
Output is correct |
4 |
Correct |
347 ms |
18600 KB |
Output is correct |
5 |
Correct |
295 ms |
17592 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
284 ms |
17908 KB |
Output is correct |
2 |
Correct |
333 ms |
18632 KB |
Output is correct |
3 |
Correct |
258 ms |
17444 KB |
Output is correct |
4 |
Correct |
340 ms |
17056 KB |
Output is correct |
5 |
Correct |
299 ms |
18360 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
291 ms |
17080 KB |
Output is correct |
2 |
Incorrect |
320 ms |
17540 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
331 ms |
17336 KB |
Output is correct |
2 |
Correct |
398 ms |
17408 KB |
Output is correct |
3 |
Correct |
314 ms |
17936 KB |
Output is correct |
4 |
Incorrect |
387 ms |
17716 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
325 ms |
18844 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
374 ms |
18848 KB |
Output is correct |
2 |
Correct |
447 ms |
18356 KB |
Output is correct |
3 |
Correct |
347 ms |
17804 KB |
Output is correct |
4 |
Correct |
454 ms |
18356 KB |
Output is correct |
5 |
Correct |
400 ms |
18356 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
403 ms |
18112 KB |
Output is correct |
2 |
Correct |
467 ms |
31796 KB |
Output is correct |
3 |
Correct |
450 ms |
30804 KB |
Output is correct |
4 |
Correct |
560 ms |
35944 KB |
Output is correct |
5 |
Correct |
533 ms |
29872 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
467 ms |
18100 KB |
Output is correct |
2 |
Correct |
551 ms |
17076 KB |
Output is correct |
3 |
Correct |
446 ms |
17304 KB |
Output is correct |
4 |
Incorrect |
620 ms |
18076 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |