# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
220602 | arnold518 | Balloons (CEOI11_bal) | C++14 | 191 ms | 12148 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MAXN = 2e5;
int N;
ll X[MAXN+10];
long double R[MAXN+10];
int main()
{
int i, j;
scanf("%d", &N);
for(i=1; i<=N; i++) scanf("%lld%Lf", &X[i], &R[i]);
vector<int> S;
for(i=1; i<=N; i++)
{
while(!S.empty())
{
R[i]=min(R[i], (long double)(X[i]-X[S.back()])*(X[i]-X[S.back()])/(4*R[S.back()]));
if(R[i]<=R[S.back()]) break;
else S.pop_back();
}
S.push_back(i);
}
for(i=1; i<=N; i++) printf("%.10Lf\n", R[i]);
}
Compilation message (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... |