Submission #858113

# Submission time Handle Problem Language Result Execution time Memory
858113 2023-10-07T12:20:10 Z ColourAttila Balloons (CEOI11_bal) C++17
0 / 100
68 ms 6908 KB
#include <bits/stdc++.h>
using namespace std;
#define InTheNameOfGod ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);
using ll = long long;

const int maxN = 2e5 + 5;
const int MOD = 1e9 + 7;
const int INF = 1e9 + 7;

double val(double x, double r) {
    return x*x/4.0/r;
}

int main() {
   InTheNameOfGod;

    int n;
    cin >> n;

    vector<pair<double, double> > v(n);
    for(int i = 0; i < n; i++) {
        cin >> v[i].first >> v[i].second;
    }
    vector<int> ind;
    ind.push_back(0);
    vector<double> mo = {v[0].second};
    for(int i = 1; i < n; i++) {
        while(ind.size() > 1 && val(v[i].first-v[ind[ind.size()-2]].first, mo[ind[ind.size()-2]]) <= val(v[i].first-v[ind[ind.size()-1]].first, mo[ind[ind.size()-1]])) {
            ind.pop_back();
        }
        int j = ind.back();
        double x = v[i].first - v[j].first;
        double mini = min(v[i].second, val(x, mo[j]));
        mo.push_back(mini);
        while(mo[ind.back()] < mini) ind.pop_back();
        ind.push_back(i);
    }
    cout << fixed << setprecision(3);
    for(int i = 0; i < n; i++) cout << mo[i] << endl;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 348 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 348 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 856 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 604 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 7 ms 1040 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 19 ms 3160 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 37 ms 3924 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 52 ms 4436 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 53 ms 5460 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 68 ms 6908 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -