# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1005805 |
2024-06-23T05:24:52 Z |
Mubaris |
Balloons (CEOI11_bal) |
C++17 |
|
439 ms |
7764 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:0);
}
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()&&f(b[st.top()],b[i],c[i],c[st.top()])) {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 |
432 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 |
348 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 |
5 ms |
452 KB |
14th numbers differ - expected: '108.0020000000', found: '762.0000000000', error = '653.9980000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
45 ms |
1064 KB |
53rd numbers differ - expected: '156.0000000000', found: '7168.0000000000', error = '7012.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
106 ms |
2096 KB |
6752nd numbers differ - expected: '7948.0000000000', found: '25147.0000000000', error = '17199.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
243 ms |
4496 KB |
1862nd numbers differ - expected: '5904.0000000000', found: '17918.0000000000', error = '12014.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
280 ms |
5300 KB |
182nd numbers differ - expected: '4863.0000000000', found: '14737.0000000000', error = '9874.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
342 ms |
6996 KB |
61st numbers differ - expected: '1810.0000000000', found: '11087.0000000000', error = '9277.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
439 ms |
7764 KB |
64th numbers differ - expected: '2897.0000000000', found: '9497.0000000000', error = '6600.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |