Submission #958948

# Submission time Handle Problem Language Result Execution time Memory
958948 2024-04-07T09:20:25 Z biximo Mobile (BOI12_mobile) C++17
0 / 100
308 ms 8276 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) return false;
		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-3) {
    	ld m=(l+h)/2;
    	if(check(m)) {
    		ans = m;
    		h = m;
    	} else {
    		l = m;
    	}
    }
    cout << fixed << setprecision(4) << ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 348 KB Output isn't correct
2 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 Incorrect 2 ms 512 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 21 ms 2888 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 23 ms 2696 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 25 ms 2652 KB Output is correct
2 Incorrect 25 ms 2652 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 30 ms 2648 KB Output is correct
2 Incorrect 36 ms 2648 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 32 ms 2648 KB Output is correct
2 Incorrect 29 ms 2652 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 140 ms 4700 KB Output is correct
2 Incorrect 147 ms 4724 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 154 ms 4728 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 168 ms 6736 KB Output is correct
2 Incorrect 177 ms 6772 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 187 ms 6768 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 199 ms 6736 KB Output is correct
2 Incorrect 236 ms 6992 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 204 ms 6776 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 223 ms 6740 KB Output is correct
2 Incorrect 246 ms 6992 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 253 ms 6740 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 285 ms 8276 KB Output is correct
2 Incorrect 308 ms 8072 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 307 ms 8264 KB Output isn't correct
2 Halted 0 ms 0 KB -