Submission #482372

# Submission time Handle Problem Language Result Execution time Memory
482372 2021-10-24T08:00:53 Z chungdinh Balloons (CEOI11_bal) C++17
50 / 100
2000 ms 2220 KB
#include <cstdio>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <iostream>
#include <cstring>

using namespace std;

#define ll long long
#define ii pair<int, int>
#define FOR(i, l, r) for (int i = (l); i <= (r); i++)
#define all(x) x.begin(), x.end()

const int N = 5e5 + 5;
const ll MOD = 998244353;

int n;
pair<long double, long double> a[N];
long double z[N];

int main() {
    #ifdef CHUNGDINH
    freopen("main.inp","r",stdin);
    #endif // CHUNGDINH

    cin >> n;
    for (int i = 1; i <= n; i++) {
        cin >> a[i].first >> a[i].second;

        long double tt = a[i].second;
        for (int j = i - 1; j >= 1; j--) tt = min(tt, (a[i].first - a[j].first) * (a[i].first - a[j].first) / 4 / z[j]);

        z[i] = tt;
        printf("%.3Lf\n", z[i]);
    }
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB 10 numbers
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB 2 numbers
# Verdict Execution time Memory Grader output
1 Correct 2 ms 332 KB 505 numbers
# Verdict Execution time Memory Grader output
1 Correct 14 ms 408 KB 2000 numbers
# Verdict Execution time Memory Grader output
1 Correct 929 ms 1360 KB 20000 numbers
# Verdict Execution time Memory Grader output
1 Execution timed out 2079 ms 1980 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2069 ms 2104 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Execution timed out 2084 ms 2220 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2081 ms 2124 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2094 ms 2044 KB Time limit exceeded
2 Halted 0 ms 0 KB -