| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1314303 | kingboy | Balloons (CEOI11_bal) | C++20 | 96 ms | 2468 KiB |
#include <iostream>
#include <vector>
#include <stack>
using namespace std;
int foundRadius(int x1, int x2, int r1) {
return (x1-x2) * (x1-x2) / (4*r1);
}
int main() {
int n;
cin >> n;
vector<pair<int, int>> vec;
stack<pair<int, int>> st;
for (int x=0;x<n;x++) {
int xpos, r;
cin >> xpos >> r;
vec.push_back({xpos, r});
}
for (int x=0;x<n;x++) {
int r = vec[x].second;
while (!st.empty()) {
r = foundRadius(vec[x].first, st.top().first, st.top().second);
if (r >= st.top().second) {
st.pop();
}
else {
break;
}
}
cout << r << endl;
st.push({vec[x].first, r});
}
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
