제출 #739439

#제출 시각아이디문제언어결과실행 시간메모리
739439LKR__enjoyerBalloons (CEOI11_bal)C++17
10 / 100
554 ms7904 KiB
#include<bits/stdc++.h> #include <iostream> #define f first #define s second #define pb push_back typedef long double ld; using namespace std; stack<pair<ld,ld>> balon; int n; vector<ld> odp; void spr(ld poz,ld mini){ while(balon.empty()==0){ ld t_poz=balon.top().f,t_s=balon.top().s; ld curr_s=(poz-t_poz)*(poz-t_poz)/(4*t_s); mini=min(curr_s,mini); curr_s=mini; if(curr_s>t_s)balon.pop(); else {balon.push({poz,curr_s}); break;} } odp.pb(mini); } int main() { cin>>n; for(int i=0;i<n;i++){ld a,b; cin>>a>>b; if(i)spr(a,b); else {balon.push({a,b}); odp.pb(b);}} for(auto i : odp)cout<<fixed<<setprecision(3)<<i<<endl; return 0; }
#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...