# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
485100 | largefence | Balloons (CEOI11_bal) | C++17 | 2099 ms | 6424 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define pw2(x) ((x)*(x))
double x[200000], r[200000], pck[200000];
int main() {
//ios::sync_with_stdio(false);
//cin.tie(0);
//freopen("ws.INP", "r", stdin);
//freopen("ws.OUT", "w", stdout);
int n; scanf("%d", &n);
for (int i = 0; i < n; i++)
scanf("%lf %lf", &x[i], &r[i]);//cin >> x[i] >> r[i];
pck[0] = r[0]; printf("%.3lf\n", pck[0]);
int jj = 0;
for (int i = 1; i < n; i++) {
pck[i] = r[i];
/*
if distance between 2 center < sum of rad of circles => intersect
^ <=> sqrt((x[i] - x[j])^2 + (h[i] - h[j])^2) == h[i] + h[j] => maximal
*/
for (int j = jj; j < i; j++)
pck[i] = min(pck[i], pw2(x[i] - x[j]) / (4.0 * pck[j]));
while (pck[jj] < pck[i]) jj++; // if before and not bigger it is definitely not a candidate
printf("%.3lf\n", pck[i]);
}
return 0;
}
// How to AC ?
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |