Submission #925447

# Submission time Handle Problem Language Result Execution time Memory
925447 2024-02-11T16:23:08 Z BoopyTheNoob Balloons (CEOI11_bal) C++14
0 / 100
2000 ms 8276 KB
#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);
}

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++) {
        scanf("%lf", &info[i].first);
        scanf("%lf", &info[i].second);
    }
    subtask1(info);
    return 0;
}

Compilation message

bal.cpp: In function 'void subtask1(std::vector<std::pair<double, double> >)':
bal.cpp:7:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<double, double> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    7 |     for (int i = 1; i < info.size(); i++) {
      |                     ~~^~~~~~~~~~~~~
bal.cpp: In function 'int main()':
bal.cpp:24:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   24 |         scanf("%lf", &info[i].first);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
bal.cpp:25:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   25 |         scanf("%lf", &info[i].second);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB 1st numbers differ - expected: '24.0000000000', found: '0.0000000000', error = '24.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB 1st numbers differ - expected: '247294217.0000000000', found: '0.0000000000', error = '247294217.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB 1st numbers differ - expected: '213.0000000000', found: '0.0000000000', error = '213.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 344 KB 1st numbers differ - expected: '123.0000000000', found: '54.0000000000', error = '69.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 318 ms 1364 KB 1st numbers differ - expected: '213.0000000000', found: '6840.0000000000', error = '6627.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1939 ms 2664 KB 1st numbers differ - expected: '15399.0000000000', found: '22358.0000000000', error = '6959.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2032 ms 4176 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2029 ms 4948 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2044 ms 6484 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2058 ms 8276 KB Time limit exceeded
2 Halted 0 ms 0 KB -