# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1005055 |
2024-06-22T06:46:40 Z |
Mubaris |
Balloons (CEOI11_bal) |
C++17 |
|
3 ms |
524 KB |
#include<bits/stdc++.h>
using namespace std;
#define INF(t) numeric_limits<t>::max()
double f(int a,int b,int c,int 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<int> b(a),c(a);
stack<int> st;
for(int i=0;i<a;i++) cin>>b[i]>>c[i];
for(int i=0;i<a;i++){
double ans=(double)c[i];
while(!st.empty()&&f(b[i],b[st.top()],c[i],c[st.top()])) {ans=f(b[i],b[st.top()],c[i],c[st.top()]);st.pop();}
st.push(i);
cout<<fixed<<setprecision(3)<<ans<<endl;
}
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(0); cerr.tie(0);
#ifndef ONLINE_JUDGE
(void)!freopen("input.txt", "r", stdin);
(void)!freopen("info.txt", "w", stderr);
(void)!freopen("output.txt", "w", stdout);
#endif
int t=1;
while(t--) solve();
#ifndef ONLINE_JUDGE
cerr << "time taken: " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl;
#endif
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Unexpected end of file - double expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
348 KB |
Unexpected end of file - double expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Unexpected end of file - double expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Unexpected end of file - double expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
348 KB |
Unexpected end of file - double expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
524 KB |
Unexpected end of file - double expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Unexpected end of file - double expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Unexpected end of file - double expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Unexpected end of file - double expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Unexpected end of file - double expected |
2 |
Halted |
0 ms |
0 KB |
- |