# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
954057 | 2024-03-27T08:03:57 Z | blackslex | Balloons (CEOI11_bal) | C++17 | 90 ms | 8500 KB |
#include<bits/stdc++.h> using namespace std; int n; int main() { scanf("%d", &n); vector<int> x(n), r(n); vector<double> dp(n); // dp[i] = min {0<=j<i} {(x[i]-x[j])*(x[i]-x[j]) / 4*dp[j]} for (int i = 0; i < n; i++) scanf("%d %d", &x[i], &r[i]), dp[i] = (double) r[i]; stack<int> st; for (int i = 0; i < n; i++) { while (!st.empty() && (dp[i] = min(dp[i], (double) 1.0 * (x[st.top()] - x[i]) * (x[st.top()] - x[i]) / (4.0 * dp[st.top()]))) >= dp[st.top()]) st.pop(); st.emplace(i); } for (int i = 0; i < n; i++) printf("%.3lf\n", dp[i]); }
Compilation message
# | 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 | 344 KB | 505 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 344 KB | 2000 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 12 ms | 1000 KB | 20000 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 24 ms | 2096 KB | 50000 numbers |
2 | Correct | 21 ms | 2160 KB | 49912 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 47 ms | 3860 KB | 100000 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 58 ms | 4172 KB | 115362 numbers |
2 | Correct | 46 ms | 5208 KB | 119971 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 73 ms | 5476 KB | 154271 numbers |
2 | Correct | 81 ms | 8500 KB | 200000 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 90 ms | 6520 KB | 200000 numbers |
2 | Correct | 76 ms | 8440 KB | 199945 numbers |