Submission #1007989

# Submission time Handle Problem Language Result Execution time Memory
1007989 2024-06-26T05:10:24 Z Mubaris Balloons (CEOI11_bal) C++17
40 / 100
2000 ms 6704 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) {if((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 Correct 1 ms 344 KB 505 numbers
# Verdict Execution time Memory Grader output
1 Correct 6 ms 600 KB 2000 numbers
# Verdict Execution time Memory Grader output
1 Correct 210 ms 1112 KB 20000 numbers
# Verdict Execution time Memory Grader output
1 Correct 1016 ms 2384 KB 50000 numbers
2 Execution timed out 2044 ms 2652 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2016 ms 3804 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2058 ms 4540 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2011 ms 5636 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2039 ms 6704 KB Time limit exceeded
2 Halted 0 ms 0 KB -