Submission #924845

# Submission time Handle Problem Language Result Execution time Memory
924845 2024-02-09T22:35:38 Z VMaksimoski008 Balloons (CEOI11_bal) C++14
60 / 100
2000 ms 4232 KB
#include <bits/stdc++.h>

#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
//#define int long long

using namespace std;

using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;

const int mod = 1e9 + 7;
const int LOG = 20;
const int maxn = 1e5 + 5;
const double eps = 1e-9;

int32_t main() {
    int n;
    cin >> n;

    cout << setprecision(5) << fixed;

    vector<pdd> v(n);
    for(pdd &x : v) cin >> x.first >> x.second;

    for(int i=0; i<n; i++) {
        double curr = v[i].second;
        for(int j=0; j<i; j++)
            curr = min(curr, (v[j].first - v[i].first) * (v[j].first - v[i].first) / (4 * v[j].second));
        v[i].second = curr;
        cout << v[i].second << '\n';
    }

    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB 10 numbers
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB 2 numbers
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB 505 numbers
# Verdict Execution time Memory Grader output
1 Correct 6 ms 348 KB 2000 numbers
# Verdict Execution time Memory Grader output
1 Correct 335 ms 1124 KB 20000 numbers
# Verdict Execution time Memory Grader output
1 Correct 1972 ms 1736 KB 50000 numbers
2 Correct 1981 ms 2524 KB 49912 numbers
# Verdict Execution time Memory Grader output
1 Execution timed out 2015 ms 2504 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2047 ms 2752 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2001 ms 3664 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2019 ms 4232 KB Time limit exceeded
2 Halted 0 ms 0 KB -