Submission #1013081

#TimeUsernameProblemLanguageResultExecution timeMemory
1013081nrg_studioBalloons (CEOI11_bal)C++17
20 / 100
110 ms1860 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define pb push_back #define FOR(i, a, b, s) for (int i = (a); i < (b); i += s) #define F0R(i, a) for (int i = 0; i < (a); i++) #define pii pair<ld,ld> #define mp make_pair #define f first #define s second int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; ll x, r; stack<pii> s; cout << fixed << setprecision(3); F0R(i,n) { cin >> x >> r; ld cand = r; while (s.size()) { pii p = s.top(); cand = min((ld)(x-p.f)*(x-p.f)/p.s/4,(ld)r); if (cand >= p.s) {s.pop();} else {break;} } s.push({x,cand}); cout << cand << '\n'; } }
#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...