제출 #609463

#제출 시각아이디문제언어결과실행 시간메모리
609463kakayoshiBalloons (CEOI11_bal)C++17
100 / 100
249 ms5456 KiB
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<int, int> pii; typedef pair<ll,ll> pll; typedef pair<int, pair<int,int> > piii; typedef pair<pair<ll,ll> ,pair<ll, ll> > plll; typedef vector <ll> vi; #define forw(i,a,b) for (ll i=a;i<=(b);i++) #define forb(i,a,b) for (ll i=a;i>=(b);i--) #define fastIO {ios::sync_with_stdio(false); cin.tie(0); } #define fi first #define se second #define pu push #define puf push_front #define pb push_back #define pof pop_front #define pob pop_back #define fr front #define all(a) a.begin(),a.end() const ll oo=1e18; const ll mod=1e9+7; const int base=31; const ll maxN=3e5+5; const int tx[4]={0,1,0,-1}; const int ty[4]={1,0,-1,0}; const ll maxM=maxN*4+5; const ll block=500; typedef pair<long double, long double> pdd; ll n; void solve() { cin>>n; stack<pdd> p; cout<<fixed<<setprecision(3); forw(i,1,n) { long double x,r; cin>>x>>r; while (p.size()) { long double new_r=(x-p.top().fi)*(x-p.top().fi)/(4*p.top().se); r=min(new_r,r); if (p.top().se<=r) p.pop(); else break; } p.pu({x,r}); cout<<r<<"\n"; } } int main() { ios::sync_with_stdio(0); cin.tie(0); //freopen("test.inp","r",stdin); //freopen("test.out","w",stdout); //freopen("test.inp","r",stdin); //freopen("test.out","w",stdout); int t=1; //cin>>t; while (t--) solve(); 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...