Submission #1131651

#TimeUsernameProblemLanguageResultExecution timeMemory
1131651monostackBalloons (CEOI11_bal)C++20
30 / 100
277 ms1804 KiB
#include<bits/stdc++.h> using namespace std; #define int long long #define ld long double int32_t main(){ cout<<fixed<<setprecision(3); int n; cin>>n; vector<long double> ans; stack<pair<int,long double>> ms; for(auto i = 0; i < n; i++){ int x,r; cin>>x>>r; ld r_ = r; while(!ms.empty()){ pair<int,ld> l = ms.top(); ld d = (((ld)(x - l.first)*(ld)(x - l.first))/((ld)4*(ld)(l.second))); r_ = min(d,r_); if(d >= l.second){ ms.pop(); continue; }else break; } ms.push({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...