Submission #1063742

# Submission time Handle Problem Language Result Execution time Memory
1063742 2024-08-18T00:43:31 Z daviedu Mobile (BOI12_mobile) C++17
0 / 100
1000 ms 97576 KB
#include <bits/stdc++.h>
using namespace std;

#define fastio ios_base::sync_with_stdio(0); cin.tie(0)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define ll long long
#define ld long double

struct P{
    ll x, y;
};

void dbg_out() { cerr << endl; }
template <typename H, typename... T>
void dbg_out(H h, T... t) { cerr << ' ' << h; dbg_out(t...); }
#define dbg(...) { cerr << #__VA_ARGS__ << ':'; dbg_out(__VA_ARGS__); }

const ld prec = 0.00005;
const ld MX = 1e10;
vector<pair<ld, ld>> points;
int n, len;

bool f(ld r){
    vector<pair<ld, int>> sections;
    for (auto& [x, y]: points){
        if (r < y) continue;
        ld dx = sqrtl(r*r - y*y);
        sections.push_back({x-dx,-1});
        sections.push_back({x+dx, 1});
    }
    sort(all(sections));
    bool can=true;
    ld right=-1;
    int cur=0;
    for (auto& [x, v]: sections){
        if (right < x && x >= 0 && x < len && !cur){
            can = false;
            break;
        }
        right = x;
        cur -= v;
        if (x > len) break;
    }
    return can && right >= len;
}

signed main(){
    fastio;
    cin >> n >> len;
    points.resize(n);
    for (int i=0; i<n; i++){
        cin >> points[i].first;
        cin >> points[i].second;
    }
    
    ld l=0, r=MX, ans=MX;
    while (r-l >= prec){
        ld m = (l+r)/2;
        if (f(m)) r = m, ans = m;
        else l = m;
    }
    cout << fixed << setprecision(13);
    cout << ans << '\n';
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 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 19 ms 1076 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 36 ms 1440 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 35 ms 1528 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 50 ms 1696 KB Output is correct
2 Correct 46 ms 1460 KB Output is correct
3 Correct 44 ms 1512 KB Output is correct
4 Incorrect 30 ms 1544 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 547 ms 15904 KB Output is correct
2 Execution timed out 1002 ms 16992 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 693 ms 16040 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1035 ms 17484 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1026 ms 19128 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 964 ms 19508 KB Output is correct
2 Execution timed out 1034 ms 20396 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1063 ms 65248 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1067 ms 65368 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1020 ms 85028 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1068 ms 85080 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1086 ms 88140 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1034 ms 88176 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1056 ms 91328 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1028 ms 91268 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1068 ms 97556 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1042 ms 97576 KB Time limit exceeded
2 Halted 0 ms 0 KB -