Submission #484264

# Submission time Handle Problem Language Result Execution time Memory
484264 2021-11-02T18:07:49 Z Olympia Balloons (CEOI11_bal) C++17
10 / 100
199 ms 4236 KB
#include <vector>
#include <iostream>
#include <cassert>
#include <cmath>
#include <set>
#include <map>
#include <stack>
#include <set>
#include <iomanip>
#define ll long long
using namespace std;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin >> n;
    vector<double> x(n), r(n);
    for (int i = 0; i < n; i++) {
        cin >> x[i] >> r[i];
    }
    stack<int> indices;
    indices.push(0);
    for (int i = 1; i < n; i++) {
        while(!indices.empty()) {
            //int j = -ind;
            int j = indices.top();
            double val = ((x[i] - x[j]) * (x[i] - x[j])) / (4.0 * r[j]);
            r[i] = min(r[i], val);
            if (r[i] >= r[j]) {
                indices.pop();
            } else {
                //new_indices.insert(-j);
                break;
            }
        }
        //new_indices.insert(-i);
        //indices = new_indices;
    }
    for (double d: r) {
        cout << setprecision(30) << d << "\n";
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB 4th numbers differ - expected: '1.8420000000', found: '87.0000000000', error = '85.1580000000'
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB 2 numbers
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB 7th numbers differ - expected: '0.0010000000', found: '9.0000000000', error = '8.9990000000'
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 332 KB 3rd numbers differ - expected: '121.0000000000', found: '123.0000000000', error = '2.0000000000'
# Verdict Execution time Memory Grader output
1 Incorrect 18 ms 644 KB 3rd numbers differ - expected: '211.0000000000', found: '213.0000000000', error = '2.0000000000'
# Verdict Execution time Memory Grader output
1 Incorrect 51 ms 1328 KB 5th numbers differ - expected: '15395.0000000000', found: '15396.0000000000', error = '1.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 95 ms 2272 KB 3rd numbers differ - expected: '7936.0000000000', found: '10352.0000000000', error = '2416.0000000000'
# Verdict Execution time Memory Grader output
1 Incorrect 112 ms 2640 KB 5th numbers differ - expected: '5054.0000000000', found: '5055.0000000000', error = '1.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 178 ms 3496 KB 3rd numbers differ - expected: '1872.0000000000', found: '1874.0000000000', error = '2.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 199 ms 4236 KB 3rd numbers differ - expected: '2960.0000000000', found: '2962.0000000000', error = '2.0000000000'
2 Halted 0 ms 0 KB -