| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1324354 | sh_qaxxorov_571 | Balloons (CEOI11_bal) | C++20 | 113 ms | 1852 KiB |
#include <iostream>
#include <vector>
#include <stack>
#include <iomanip>
#include <cmath>
using namespace std;
struct Balloon {
double x, r;
};
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
stack<Balloon> s;
for (int i = 0; i < n; i++) {
double x, r_limit;
cin >> x >> r_limit;
double current_r = r_limit;
while (!s.empty()) {
// Ikki shar o'rtasidagi tegish radiusini hisoblash
double r_touch = pow(x - s.top().x, 2) / (4.0 * s.top().r);
// Radius eng kichik cheklovga teng bo'ladi
current_r = min(current_r, r_touch);
// Agar yangi shar eski shardan kattaroq bo'lsa,
// eski shar endi boshqalarga tegmaydi (yangi shar to'sib qoladi)
if (current_r >= s.top().r) {
s.pop();
} else {
break;
}
}
// Yangi sharni stekka qo'shish
s.push({x, current_r});
// Natijani chiqarish
cout << fixed << setprecision(3) << current_r << "\n";
}
return 0;
}
| # | 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... | ||||
