Submission #958949

# Submission time Handle Problem Language Result Execution time Memory
958949 2024-04-07T09:22:00 Z biximo Mobile (BOI12_mobile) C++17
12 / 100
336 ms 8064 KB
#include <bits/stdc++.h>
#define N 1000005
using namespace std;
typedef long long ll;
typedef array<int, 2> p2;
typedef long double ld;
int n, L;
p2 seq[N];
bool check(ld d) {
	ld r = 0;
	for(int i = 0; i < n; i ++) {
		auto[h,k] = seq[i];
		if(d*d-k*k<0) continue;
		if(h-sqrt(d*d-k*k) <= r) r = max(r,h+sqrt(d*d-k*k));
	}
	return r >= L;
}
int main() {
    cin.tie(0)->sync_with_stdio(0);
    cin >> n >> L;
    for(int i = 0; i < n; i ++) {
    	cin >> seq[i][0] >> seq[i][1];
    }
    ld l=1,h=1.5e9,ans;
    while(h-l>1e-5) {
    	ld m=(l+h)/2;
    	if(check(m)) {
    		ans = m;
    		h = m;
    	} else {
    		l = m;
    	}
    }
    cout << fixed << setprecision(15) << ans;
}
# 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 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 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 348 KB Output is correct
3 Correct 2 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 348 KB Output is correct
2 Correct 2 ms 348 KB Output is correct
3 Correct 2 ms 348 KB Output is correct
4 Incorrect 2 ms 344 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 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 Incorrect 2 ms 472 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 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 Incorrect 2 ms 348 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 32 ms 2908 KB Output is correct
2 Incorrect 25 ms 3768 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 20 ms 2652 KB Output is correct
2 Correct 19 ms 3416 KB Output is correct
3 Incorrect 39 ms 3676 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 28 ms 2692 KB Output is correct
2 Incorrect 27 ms 2652 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 34 ms 2652 KB Output is correct
2 Incorrect 32 ms 2652 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 37 ms 2676 KB Output is correct
2 Incorrect 31 ms 2648 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 163 ms 4724 KB Output is correct
2 Incorrect 163 ms 4688 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 163 ms 4688 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 191 ms 6772 KB Output is correct
2 Incorrect 192 ms 6740 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 210 ms 6528 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 216 ms 6776 KB Output is correct
2 Incorrect 222 ms 6772 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 222 ms 6736 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 249 ms 6776 KB Output is correct
2 Incorrect 258 ms 6772 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 268 ms 6784 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 322 ms 8064 KB Output is correct
2 Incorrect 315 ms 8056 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 336 ms 8060 KB Output isn't correct
2 Halted 0 ms 0 KB -