Submission #958778

# Submission time Handle Problem Language Result Execution time Memory
958778 2024-04-06T15:15:23 Z Trisanu_Das Mobile (BOI12_mobile) C++17
100 / 100
348 ms 35428 KB
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ff first
#define ss second

signed main(){
  ios_base::sync_with_stdio(false); cin.tie(NULL);
  int n, L; cin >> n >> L;
  pair<int, int> p[n]; for(int i = 0; i < n; i++) cin >> p[i].ff >> p[i].ss;
  double l = 1, r = 1.5e9;
  while(r - l > 1e-3){
    double mid = (l + r) / 2, chk = 0;
    for(int i = 0; i < n; i++){
      double d = sqrt(mid * mid - p[i].ss * p[i].ss);
      double a = p[i].ff - d, b = p[i].ff + d;
      if(a <= chk) chk = max(chk, b);
    }
    if(chk >= L) r = mid;
    else l = mid;
  }
  cout << fixed << setprecision(4) << l << '\n';
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 460 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 452 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 600 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 600 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 496 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 600 KB Output is correct
2 Correct 2 ms 348 KB Output is correct
3 Correct 2 ms 348 KB Output is correct
4 Correct 2 ms 600 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 Correct 2 ms 604 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 720 KB Output is correct
2 Correct 2 ms 600 KB Output is correct
3 Correct 2 ms 348 KB Output is correct
4 Correct 2 ms 468 KB Output is correct
5 Correct 2 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 26 ms 2396 KB Output is correct
2 Correct 20 ms 2652 KB Output is correct
3 Correct 13 ms 2136 KB Output is correct
4 Correct 31 ms 2648 KB Output is correct
5 Correct 13 ms 1628 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 27 ms 2396 KB Output is correct
2 Correct 21 ms 2140 KB Output is correct
3 Correct 24 ms 2652 KB Output is correct
4 Correct 25 ms 2652 KB Output is correct
5 Correct 29 ms 3164 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 19 ms 2392 KB Output is correct
2 Correct 25 ms 3024 KB Output is correct
3 Correct 25 ms 2648 KB Output is correct
4 Correct 34 ms 3932 KB Output is correct
5 Correct 25 ms 2652 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 27 ms 3552 KB Output is correct
2 Correct 26 ms 3408 KB Output is correct
3 Correct 24 ms 3044 KB Output is correct
4 Correct 35 ms 3932 KB Output is correct
5 Correct 30 ms 3028 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 26 ms 3416 KB Output is correct
2 Correct 30 ms 3420 KB Output is correct
3 Correct 28 ms 2904 KB Output is correct
4 Correct 38 ms 3912 KB Output is correct
5 Correct 33 ms 3164 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 111 ms 12348 KB Output is correct
2 Correct 131 ms 15940 KB Output is correct
3 Correct 132 ms 15672 KB Output is correct
4 Correct 184 ms 17724 KB Output is correct
5 Correct 153 ms 15092 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 133 ms 16440 KB Output is correct
2 Correct 184 ms 14672 KB Output is correct
3 Correct 125 ms 13904 KB Output is correct
4 Correct 173 ms 17856 KB Output is correct
5 Correct 151 ms 15560 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 136 ms 15004 KB Output is correct
2 Correct 159 ms 19116 KB Output is correct
3 Correct 151 ms 18516 KB Output is correct
4 Correct 210 ms 21596 KB Output is correct
5 Correct 181 ms 17760 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 159 ms 19700 KB Output is correct
2 Correct 232 ms 17752 KB Output is correct
3 Correct 143 ms 16664 KB Output is correct
4 Correct 213 ms 21344 KB Output is correct
5 Correct 200 ms 18552 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 158 ms 17444 KB Output is correct
2 Correct 174 ms 22100 KB Output is correct
3 Correct 192 ms 21740 KB Output is correct
4 Correct 270 ms 24692 KB Output is correct
5 Correct 227 ms 20432 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 181 ms 22868 KB Output is correct
2 Correct 280 ms 20604 KB Output is correct
3 Correct 178 ms 19704 KB Output is correct
4 Correct 238 ms 24780 KB Output is correct
5 Correct 219 ms 21488 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 177 ms 19736 KB Output is correct
2 Correct 196 ms 25372 KB Output is correct
3 Correct 203 ms 24400 KB Output is correct
4 Correct 274 ms 28624 KB Output is correct
5 Correct 249 ms 24188 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 206 ms 25940 KB Output is correct
2 Correct 292 ms 23540 KB Output is correct
3 Correct 203 ms 22596 KB Output is correct
4 Correct 273 ms 28316 KB Output is correct
5 Correct 248 ms 24728 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 238 ms 24656 KB Output is correct
2 Correct 251 ms 31632 KB Output is correct
3 Correct 255 ms 30424 KB Output is correct
4 Correct 347 ms 35284 KB Output is correct
5 Correct 331 ms 29908 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 273 ms 32620 KB Output is correct
2 Correct 348 ms 29516 KB Output is correct
3 Correct 250 ms 28396 KB Output is correct
4 Correct 344 ms 35428 KB Output is correct
5 Correct 306 ms 30800 KB Output is correct