Submission #991331

# Submission time Handle Problem Language Result Execution time Memory
991331 2024-06-02T03:42:25 Z BF001 Mobile (BOI12_mobile) C++17
90 / 100
1000 ms 16008 KB
#include <bits/stdc++.h>
using namespace std;
 
#define N 1000005
#define ld long double
 
int n, len;
long long x[N], y[N];
 
signed main(){
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    
    cin >> n >> len;
    for (int i = 1; i <= n; i++) cin >> x[i] >> y[i];
 
    ld l = 0, r = 2e9;
    while (r - l > 1e-3){
    	ld mid = (l + r) / 2.0;
    	ld cur = 0;
    	for (int i = 1; i <= n; i++){
    		ld denta = sqrt(mid * mid - y[i] * y[i]);
    		ld a = x[i] - denta;
    		ld b = x[i] + denta;
    		if (a <= cur) cur = max(cur, b);
    	}
    	if (cur >= len) r = mid;
    	else l = mid;
    }
 
    cout << fixed << setprecision(6) << l;
    
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2392 KB Output is correct
2 Correct 1 ms 2396 KB Output is correct
3 Correct 0 ms 2396 KB Output is correct
4 Correct 0 ms 2396 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Correct 1 ms 2396 KB Output is correct
3 Correct 0 ms 2396 KB Output is correct
4 Correct 0 ms 2396 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 2396 KB Output is correct
2 Correct 2 ms 2396 KB Output is correct
3 Correct 2 ms 2396 KB Output is correct
4 Correct 1 ms 2396 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 2396 KB Output is correct
2 Correct 3 ms 2396 KB Output is correct
3 Correct 3 ms 2396 KB Output is correct
4 Correct 5 ms 2392 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 2396 KB Output is correct
2 Correct 2 ms 2396 KB Output is correct
3 Correct 3 ms 2392 KB Output is correct
4 Correct 5 ms 2556 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 2396 KB Output is correct
2 Correct 2 ms 2396 KB Output is correct
3 Correct 3 ms 2556 KB Output is correct
4 Correct 6 ms 2396 KB Output is correct
5 Correct 4 ms 2552 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 54 ms 6748 KB Output is correct
2 Correct 24 ms 6748 KB Output is correct
3 Correct 26 ms 4700 KB Output is correct
4 Correct 88 ms 7004 KB Output is correct
5 Correct 36 ms 4700 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 62 ms 6780 KB Output is correct
2 Correct 62 ms 4700 KB Output is correct
3 Correct 76 ms 6748 KB Output is correct
4 Correct 80 ms 6748 KB Output is correct
5 Correct 97 ms 6748 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 30 ms 6748 KB Output is correct
2 Correct 28 ms 6748 KB Output is correct
3 Correct 44 ms 6748 KB Output is correct
4 Correct 119 ms 6748 KB Output is correct
5 Correct 75 ms 6744 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 30 ms 6784 KB Output is correct
2 Correct 32 ms 6744 KB Output is correct
3 Correct 46 ms 6748 KB Output is correct
4 Correct 120 ms 6744 KB Output is correct
5 Correct 93 ms 6748 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 38 ms 6740 KB Output is correct
2 Correct 31 ms 6748 KB Output is correct
3 Correct 46 ms 6748 KB Output is correct
4 Correct 119 ms 6748 KB Output is correct
5 Correct 92 ms 6744 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 168 ms 10884 KB Output is correct
2 Correct 150 ms 10832 KB Output is correct
3 Correct 163 ms 10832 KB Output is correct
4 Correct 580 ms 10876 KB Output is correct
5 Correct 471 ms 10880 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 144 ms 10836 KB Output is correct
2 Correct 383 ms 10888 KB Output is correct
3 Correct 240 ms 10876 KB Output is correct
4 Correct 574 ms 10632 KB Output is correct
5 Correct 480 ms 10884 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 208 ms 14928 KB Output is correct
2 Correct 186 ms 14928 KB Output is correct
3 Correct 191 ms 14932 KB Output is correct
4 Correct 710 ms 14932 KB Output is correct
5 Correct 571 ms 15184 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 175 ms 14928 KB Output is correct
2 Correct 468 ms 14928 KB Output is correct
3 Correct 286 ms 14932 KB Output is correct
4 Correct 693 ms 14928 KB Output is correct
5 Correct 598 ms 14932 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 235 ms 15188 KB Output is correct
2 Correct 217 ms 14936 KB Output is correct
3 Correct 226 ms 14984 KB Output is correct
4 Correct 825 ms 14972 KB Output is correct
5 Correct 654 ms 14980 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 210 ms 14932 KB Output is correct
2 Correct 555 ms 14932 KB Output is correct
3 Correct 337 ms 14984 KB Output is correct
4 Correct 828 ms 14976 KB Output is correct
5 Correct 706 ms 14980 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 269 ms 14936 KB Output is correct
2 Correct 251 ms 15184 KB Output is correct
3 Correct 269 ms 14928 KB Output is correct
4 Correct 979 ms 14928 KB Output is correct
5 Correct 762 ms 14980 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 228 ms 14976 KB Output is correct
2 Correct 616 ms 14928 KB Output is correct
3 Correct 389 ms 14980 KB Output is correct
4 Correct 939 ms 14936 KB Output is correct
5 Correct 787 ms 14928 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 331 ms 15996 KB Output is correct
2 Correct 324 ms 16008 KB Output is correct
3 Correct 294 ms 15956 KB Output is correct
4 Execution timed out 1075 ms 16004 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 292 ms 15952 KB Output is correct
2 Correct 756 ms 16008 KB Output is correct
3 Correct 485 ms 15952 KB Output is correct
4 Execution timed out 1062 ms 16004 KB Time limit exceeded
5 Halted 0 ms 0 KB -