# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
680258 |
2023-01-10T10:44:49 Z |
peijar |
Balloons (CEOI11_bal) |
C++17 |
|
203 ms |
12620 KB |
#include <bits/stdc++.h>
#define int long long
using namespace std;
namespace std {
template <typename T> ostream &operator<<(ostream &out, const vector<T> &vec) {
out << "[";
for (int i = 0; i < (int)vec.size(); ++i) {
out << vec[i];
if (i + 1 < (int)vec.size())
out << ", ";
}
return out << "]";
}
} // namespace std
void dbg_out() { cout << endl; }
template <typename Head, typename... Tail> void dbg_out(Head H, Tail... T) {
cout << ' ' << H;
dbg_out(T...);
}
#ifdef DEBUG
#define dbg(...) cout << "(" << #__VA_ARGS__ << "):", dbg_out(__VA_ARGS__)
#else
#define dbg(...)
#endif
double sq(int x) { return x * x; }
signed main(void) {
ios_base::sync_with_stdio(false);
cin.tie(0);
int N;
cin >> N;
vector<int> x(N);
vector<double> r(N);
for (int i = 0; i < N; ++i) {
cin >> x[i] >> r[i];
}
stack<pair<int, double>> stk;
for (int i = 0; i < N; ++i) {
while (!stk.empty()) {
auto [X, R] = stk.top();
r[i] = min(r[i], sq(X - x[i]) / (4 * R));
if (r[i] > R)
stk.pop();
else
break;
}
stk.emplace(x[i], r[i]);
}
for (int i = 0; i < N; ++i) {
cout << setprecision(15) << fixed << r[i] << '\n';
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
10 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
2 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
505 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
340 KB |
2000 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
21 ms |
1184 KB |
20000 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
53 ms |
2844 KB |
50000 numbers |
2 |
Correct |
57 ms |
2828 KB |
49912 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
112 ms |
4640 KB |
100000 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
124 ms |
5224 KB |
115362 numbers |
2 |
Correct |
109 ms |
7716 KB |
119971 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
168 ms |
6380 KB |
154271 numbers |
2 |
Correct |
171 ms |
12620 KB |
200000 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
203 ms |
7892 KB |
200000 numbers |
2 |
Correct |
184 ms |
12620 KB |
199945 numbers |