# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
532176 | 2022-03-02T08:56:25 Z | rsjw | Balloons (CEOI11_bal) | C++14 | 144 ms | 9112 KB |
#include <bits/stdc++.h> using namespace std; double x[200010],r[200010]; stack<int> s; int main(){ int n,i; scanf("%d",&n); for(i=1;i<=n;i++) scanf("%lf%lf",&x[i],&r[i]); for(i=1;i<=n;i++) { while(!s.empty()) { r[i]=min(r[i],(x[i]-x[s.top()])*(x[i]-x[s.top()])/4.0/r[s.top()]); if(r[s.top()]<=r[i]) s.pop(); else break; } s.push(i); } for(i=1;i<=n;i++) printf("%lf\n",r[i]); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 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 | 304 KB | 505 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 508 KB | 2000 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 18 ms | 952 KB | 20000 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 35 ms | 2372 KB | 50000 numbers |
2 | Correct | 30 ms | 2492 KB | 49912 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 75 ms | 4420 KB | 100000 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 82 ms | 5156 KB | 115362 numbers |
2 | Correct | 71 ms | 5488 KB | 119971 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 117 ms | 6876 KB | 154271 numbers |
2 | Correct | 117 ms | 9112 KB | 200000 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 144 ms | 8376 KB | 200000 numbers |
2 | Correct | 114 ms | 9068 KB | 199945 numbers |