Submission #656520

#TimeUsernameProblemLanguageResultExecution timeMemory
656520NafeeszxBalloons (CEOI11_bal)C++14
50 / 100
2090 ms4948 KiB
#pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> using namespace std; #define trav(a, x) for(auto& a : x) #define FOR(i, a, b) for (int i=(a); i<=(signed)(b); i++) #define ROF(i, a, b) for (int i=(a); i>=(signed)(b); i--) #define F0R(i, a) for (int i=0; i<(signed)(a); i++) #define vi vector<int> #define vvl vector<vector<ll>> #define all(v) (v).begin(), (v).end() typedef long long ll; void setIO(string name = "") { ios_base::sync_with_stdio(0); cin.tie(0); if(name.size()){ freopen((name+".in").c_str(), "r", stdin); freopen((name+".out").c_str(), "w", stdout); } } const int N = 1e6; const ll mod = 1e9 + 7, MOD = 998244353; int main() { setIO(); int n; cin >> n; vector<pair<double, double>> v(n); vector<double> res(n, 1e18); F0R(i, n) { cin >> v[i].first >> v[i].second; } res[0] = v[0].second; FOR(i, 1, n-1) { F0R(j, i) { res[i] = min(res[i], ((v[i].first - v[j].first) * (v[i].first - v[j].first)) / (4 * res[j])); } res[i] = min(res[i], v[i].second*1.0); } F0R(i, n) cout << fixed << setprecision(3) << res[i] << "\n"; return 0; }

Compilation message (stderr)

bal.cpp: In function 'void setIO(std::string)':
bal.cpp:17:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   17 |         freopen((name+".in").c_str(), "r", stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bal.cpp:18:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   18 |         freopen((name+".out").c_str(), "w", stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#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...