Submission #403052

# Submission time Handle Problem Language Result Execution time Memory
403052 2021-05-12T17:23:11 Z SirCovidThe19th Balloons (CEOI11_bal) C++14
100 / 100
761 ms 5396 KB
#include <bits/stdc++.h>
using namespace std;

int main(){
    
    int n; cin >> n;
    //pos, rad
    stack<pair<long double, long double>> stack;
    for (int i = 0; i < n; i++){
        long double loc, sz; cin >> loc >> sz;
        while (!stack.empty()){
            sz = min(sz, ((loc-stack.top().first)*(loc-stack.top().first))/(4*stack.top().second));
            if (sz >= stack.top().second) stack.pop();
            else break;
        }
        stack.push({loc, sz});
        cout<<fixed<<setprecision(3)<<sz<<endl;
    }
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB 10 numbers
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB 2 numbers
# Verdict Execution time Memory Grader output
1 Correct 3 ms 204 KB 505 numbers
# Verdict Execution time Memory Grader output
1 Correct 8 ms 204 KB 2000 numbers
# Verdict Execution time Memory Grader output
1 Correct 74 ms 420 KB 20000 numbers
# Verdict Execution time Memory Grader output
1 Correct 198 ms 952 KB 50000 numbers
2 Correct 186 ms 1556 KB 49912 numbers
# Verdict Execution time Memory Grader output
1 Correct 386 ms 1384 KB 100000 numbers
# Verdict Execution time Memory Grader output
1 Correct 434 ms 1584 KB 115362 numbers
2 Correct 449 ms 3284 KB 119971 numbers
# Verdict Execution time Memory Grader output
1 Correct 601 ms 1776 KB 154271 numbers
2 Correct 761 ms 5384 KB 200000 numbers
# Verdict Execution time Memory Grader output
1 Correct 755 ms 1976 KB 200000 numbers
2 Correct 761 ms 5396 KB 199945 numbers