Submission #925450

#TimeUsernameProblemLanguageResultExecution timeMemory
925450BoopyTheNoobBalloons (CEOI11_bal)C++14
60 / 100
2039 ms8188 KiB
#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++) { cin >> info[i].first >> info[i].second; } subtask1(info); return 0; }

Compilation message (stderr)

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++) {
      |                     ~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...