| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1314311 | kingboy | Balloons (CEOI11_bal) | C++20 | 329 ms | 1540 KiB |
#include <iostream>
#include <stack>
using namespace std;
int main() {
int n;
cin >> n;
stack<pair<double, double>> st;
for (int x=0;x<n;x++) {
double xpos, maxRadius;
cin >> xpos >> maxRadius;
while (!st.empty()) {
double maxAllowableRadius = (xpos-st.top().first) * (xpos-st.top().first) / (4*st.top().second);
if (maxAllowableRadius <= maxRadius) {
maxRadius = maxAllowableRadius;
}
// covers previous balloon
if (maxRadius >= st.top().second) {
st.pop();
} else {
break;
}
}
cout << maxRadius << endl;
st.push({xpos, maxRadius});
}
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
