# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
649534 |
2022-10-10T11:48:36 Z |
parsadox2 |
Balloons (CEOI11_bal) |
C++14 |
|
565 ms |
9304 KB |
#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
int x[maxn] , n;
long double r[maxn];
vector <int> st;
void f(int ps)
{
int j = st.back();
long double tmp = 1.0 * (x[ps] - x[j]) / (1.0 * 4 * r[j]);
tmp = 1.0 * tmp * (x[ps] - x[j]);
r[ps] = min(r[ps] , tmp);
}
int main()
{
cin >> n;
for(int i = 0 ; i < n ; i++)
cin >> x[i] >> r[i];
for(int i = 0 ; i < n ; i++)
{
while(!st.empty())
{
f(i);
if(r[i] >= r[st.back()])
st.pop_back();
else
break;
}
st.push_back(i);
}
for(int i = 0 ; i < n ; i++)
cout << setprecision(3) << fixed << r[i] << endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
10 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
2 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
308 KB |
505 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
340 KB |
2000 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
57 ms |
1092 KB |
20000 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
133 ms |
2444 KB |
50000 numbers |
2 |
Correct |
134 ms |
2668 KB |
49912 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
261 ms |
4520 KB |
100000 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
323 ms |
5304 KB |
115362 numbers |
2 |
Correct |
343 ms |
5668 KB |
119971 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
412 ms |
6972 KB |
154271 numbers |
2 |
Correct |
551 ms |
9304 KB |
200000 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
565 ms |
8616 KB |
200000 numbers |
2 |
Correct |
554 ms |
9232 KB |
199945 numbers |