Submission #551284

# Submission time Handle Problem Language Result Execution time Memory
551284 2022-04-20T08:18:15 Z narcissus Mobile (BOI12_mobile) C++17
0 / 100
1000 ms 27160 KB
#include <iostream>
#include <algorithm>
#include <cmath>
#include <iomanip>

using namespace std;

int main()
{
    int n, l;
    cin >> n >> l;
    pair<int, int> coords[n];
    for (int i = 0; i < n; i++) {
        cin >> coords[i].first >> coords[i].second;
    }

    double low = 1, high = 2e9;
    while (high - low > 1e-3) {
        double mid = low + (high - low) / 2;
        // cout << mid << ":" << endl;
        double maxv = 0;
        for (int i = 0; i < n; i++) {
            int x = coords[i].first;
            int y = coords[i].second;
            double xdist = sqrt(abs(pow(mid, 2) - pow(y, 2)));
            double a1 = max((double)0, x - xdist);
            double a2 = min((double)l, x + xdist);
            // cout << "a " << a1 << ' ' << a2 << endl;
            if (a1 <= maxv)
                maxv = max(maxv, a2);
        }
        if (maxv >= l) {
            high = mid;
        } else {
            low = mid;
        }
    }
    cout << fixed << setprecision(4) << high << endl;

    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 312 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 58 ms 1648 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 67 ms 1632 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 50 ms 1584 KB Output is correct
2 Correct 63 ms 2064 KB Output is correct
3 Incorrect 60 ms 1832 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 90 ms 2576 KB Output is correct
2 Correct 90 ms 2444 KB Output is correct
3 Incorrect 67 ms 1996 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 77 ms 2452 KB Output is correct
2 Correct 83 ms 2452 KB Output is correct
3 Incorrect 69 ms 2060 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 303 ms 6860 KB Output is correct
2 Correct 427 ms 11896 KB Output is correct
3 Correct 379 ms 11352 KB Output is correct
4 Incorrect 515 ms 13744 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 422 ms 6860 KB Output is correct
2 Incorrect 369 ms 10700 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 335 ms 7780 KB Output is correct
2 Correct 498 ms 14168 KB Output is correct
3 Correct 493 ms 13648 KB Output is correct
4 Incorrect 584 ms 16736 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 504 ms 7596 KB Output is correct
2 Incorrect 438 ms 12876 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 417 ms 8440 KB Output is correct
2 Correct 568 ms 16488 KB Output is correct
3 Correct 529 ms 15900 KB Output is correct
4 Incorrect 678 ms 19304 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 769 ms 8156 KB Output is correct
2 Incorrect 506 ms 14952 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 458 ms 9176 KB Output is correct
2 Correct 617 ms 18988 KB Output is correct
3 Correct 591 ms 18036 KB Output is correct
4 Incorrect 769 ms 22132 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 688 ms 8852 KB Output is correct
2 Incorrect 625 ms 17088 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 591 ms 10808 KB Output is correct
2 Correct 832 ms 23616 KB Output is correct
3 Correct 805 ms 22544 KB Output is correct
4 Execution timed out 1060 ms 27160 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 856 ms 8192 KB Output is correct
2 Incorrect 771 ms 21264 KB Output isn't correct
3 Halted 0 ms 0 KB -