# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
925468 | BoopyTheNoob | Balloons (CEOI11_bal) | C++14 | 123 ms | 13056 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
void subtask1 (vector<pair<double, double>> info) {
vector<double> ans(info.size());
ans[0] = info[0].second;
for (int i = 1; i < info.size(); i++) {
double pans = 1e9;
for (int j = 0; j < i; j++)
pans = min(pans, (info[i].first - info[j].first) * (info[i].first - info[j].first) / (4 * ans[j]));
ans[i] = min(pans, info[i].second);
}
for (auto x: ans) printf("%.3lf\n", x);
}
void subtask2 (vector<pair<double, double>> info) {
vector<double> ans(info.size());
vector<pair<double, double>> q;
ans[0] = info[0].second;
q.push_back({info[0].first, ans[0]});
for (int i = 1; i < info.size(); i++) {
double pans = info[i].second;
int j = q.size() - 1;
for (; j >= 0; j--) {
double span = (info[i].first - q[j].first) * (info[i].first - q[j].first) / (4 * q[j].second);
if (span <= pans) pans = span;
else {
j++;
break;
}
}
ans[i] = pans;
for (int k = j + 1; k < q.size(); k++)
q.pop_back();
q.push_back({info[i].first, ans[i]});
}
for (auto x: ans) printf("%.3lf\n", x);
}
int main (void) {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;
cin >> n;
vector<pair<double, double>> info(n);
for (int i = 0; i < n; i++)
cin >> info[i].first >> info[i].second;
subtask2(info);
return 0;
}
컴파일 시 표준 에러 (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... |