Submission #1005807

# Submission time Handle Problem Language Result Execution time Memory
1005807 2024-06-23T05:27:41 Z Mubaris Balloons (CEOI11_bal) C++17
10 / 100
401 ms 4948 KB
#include<bits/stdc++.h>
using namespace std;
double f(int a,int b,double c,double d){
    int dist=(b-a)*(b-a);
    double ans=(double)dist/4;ans=(double)ans/d;
    return (ans<c?ans:c);
}
void solve(){
    int a;cin>>a;
    vector<double> b(a),c(a);
    for(int i=0;i<a;i++) cin>>b[i]>>c[i];
    for(int i=0;i<a;i++){
        stack<int> st;
        int j=1;while((i>=j)&&(b[i]-b[i-j])<(c[i]+c[i-j])) {st.push(i-j);j++;}
        while(!st.empty()) {c[i]=f(b[i],b[st.top()],c[i],c[st.top()]);st.pop();}
        cout<<fixed<<setprecision(3)<<c[i]<<endl;
    }
}
int main(){
    int t=1;
    while(t--)	solve();
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB 10 numbers
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB 2nd numbers differ - expected: '252735385.4379999936', found: '0.9330000000', error = '252735384.5049999952'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB 3rd numbers differ - expected: '0.0420000000', found: '3.0000000000', error = '2.9580000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 344 KB 399th numbers differ - expected: '9.9760000000', found: '37.0000000000', error = '27.0240000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 41 ms 852 KB 1209th numbers differ - expected: '72.2820000000', found: '178.0000000000', error = '105.7180000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 100 ms 1620 KB 13945th numbers differ - expected: '0.0140000000', found: '7.0000000000', error = '6.9860000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 204 ms 2640 KB 7236th numbers differ - expected: '0.0070000000', found: '7.0000000000', error = '6.9930000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 263 ms 3512 KB 4645th numbers differ - expected: '0.0260000000', found: '8.0000000000', error = '7.9740000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 375 ms 4648 KB 1736th numbers differ - expected: '0.0050000000', found: '3.0000000000', error = '2.9950000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 401 ms 4948 KB 2718th numbers differ - expected: '2.2100000000', found: '3.0000000000', error = '0.7900000000'
2 Halted 0 ms 0 KB -