# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
948493 |
2024-03-18T07:03:27 Z |
lssply |
Balloons (CEOI11_bal) |
C++17 |
|
156 ms |
8692 KB |
#include <bits/stdc++.h>
using namespace std;
//#define cin fin
//#define cout fout
ifstream fin("conexidad.in");
ofstream fout("conexidad.out");
#define int unsigned long long
#define pii pair<int,int>
#define pb push_back
#define vi vector<int>
#define vp vector<pair<int,int>>
const int maxNr=2e5, mod = 1e9+7, inf = 2e9;
int n;
struct cv{double x; double r;}a[maxNr+1];
double calc(cv x, cv y)
{
return (x.x-y.x)*(x.x-y.x)/(4*x.r);
}
signed main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cin >> n;
for(int i=1;i<=n;i++)
cin >> a[i].x >> a[i].r;
stack<int>st;
for(int i=1;i<=n;i++)
{
while(!st.empty())
{
double r=min(calc(a[st.top()], a[i]), a[i].r);
a[i].r=r;
if(r>=a[st.top()].r)
{
st.pop();
}
else break;
}
cout << fixed << setprecision(3) << a[i].r << '\n';
st.push(i);
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 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 |
348 KB |
505 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
348 KB |
2000 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
16 ms |
2940 KB |
20000 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
43 ms |
3668 KB |
50000 numbers |
2 |
Correct |
37 ms |
3920 KB |
49912 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
80 ms |
4924 KB |
100000 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
92 ms |
5264 KB |
115362 numbers |
2 |
Correct |
87 ms |
5604 KB |
119971 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
133 ms |
6640 KB |
154271 numbers |
2 |
Correct |
151 ms |
8692 KB |
200000 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
156 ms |
7764 KB |
200000 numbers |
2 |
Correct |
143 ms |
8504 KB |
199945 numbers |