# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
998611 |
2024-06-14T10:48:56 Z |
hippo123 |
Balloons (CEOI11_bal) |
C++17 |
|
439 ms |
11876 KB |
#include <bits/stdc++.h>
using namespace std;
#define pr pair<double, int>
#define ll long long
#define pb push_back
#define f first
#define s second
int main(){
int n; cin>>n;
vector<double> x(n), r(n);
for (int i=0;i<n; i++) cin>>x[i]>>r[i];
stack<pr> st;
double ans[n];
for (int i=0; i<n; i++){
double br=r[i];
while(!st.empty() ){
br=min(br, (x[i]-st.top().s)*(x[i]-st.top().s)/(4*st.top().f));
if(br>st.top().f){
st.pop();
}
else{
break;
}
}
st.push({br, x[i]});
ans[i]=br;
}
cout << fixed << setprecision(3);
for (int i=0; i<n; i++) cout<<ans[i]<<endl;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
10 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
2 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
505 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
348 KB |
2000 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
38 ms |
1220 KB |
20000 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
99 ms |
2896 KB |
50000 numbers |
2 |
Correct |
97 ms |
3156 KB |
49912 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
197 ms |
5200 KB |
100000 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
229 ms |
5816 KB |
115362 numbers |
2 |
Correct |
232 ms |
7248 KB |
119971 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
307 ms |
7712 KB |
154271 numbers |
2 |
Correct |
432 ms |
11856 KB |
200000 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
439 ms |
9296 KB |
200000 numbers |
2 |
Correct |
433 ms |
11876 KB |
199945 numbers |