# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
480335 |
2021-10-15T17:15:29 Z |
Deepesson |
Balloons (CEOI11_bal) |
C++17 |
|
267 ms |
5480 KB |
#include <bits/stdc++.h>
using ld = long double;
typedef std::pair<ld,ld> pll;
ld raio(ld d,ld r2){
return (d*d)/(4*r2);
}
int main()
{
std::ios::sync_with_stdio(false);
std::cin.tie(0);
std::cout.tie(0);
int N;
std::cin>>N;
std::stack<pll> stack;
for(int _ = 0;_!=N;++_){
ld x,r;
std::cin>>x>>r;
while(stack.size()){
ld l = raio(stack.top().first-x,stack.top().second);
l=std::min(l,r);
if(l>=stack.top().second){
stack.pop();
r=std::min(l,r);
}else {
r=l;
break;
}
}
stack.push({x,r});
std::cout<<std::fixed<<std::setprecision(3)<<r<<"\n";
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
10 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
2 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
505 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
332 KB |
2000 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
26 ms |
456 KB |
20000 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
65 ms |
960 KB |
50000 numbers |
2 |
Correct |
67 ms |
1572 KB |
49912 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
135 ms |
1476 KB |
100000 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
158 ms |
1560 KB |
115362 numbers |
2 |
Correct |
156 ms |
3396 KB |
119971 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
208 ms |
1868 KB |
154271 numbers |
2 |
Correct |
242 ms |
5480 KB |
200000 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
267 ms |
1868 KB |
200000 numbers |
2 |
Correct |
244 ms |
5444 KB |
199945 numbers |