제출 #1195908

#제출 시각아이디문제언어결과실행 시간메모리
1195908petezaBalloons (CEOI11_bal)C++17
100 / 100
119 ms1996 KiB
#include <bits/stdc++.h> using namespace std; using db = double; using pdd = pair<db, db>; deque<pdd> stk; int n; db x, r; db getrad(pdd xr, db xtwo) { return (xr.first - xtwo) * (xr.first - xtwo) / 4 / xr.second; } int main() { cin.tie(0) -> sync_with_stdio(0); cin >> n; cout << fixed << setprecision(3); while(n--) { cin >> x >> r; while(!stk.empty()) { auto res = getrad(stk.back(), x); r = min(r, res); if(stk.back().second <= r) stk.pop_back(); else break; } stk.emplace_back(x, r); cout << r << '\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...