Submission #837750

#TimeUsernameProblemLanguageResultExecution timeMemory
837750XiaoyangBalloons (CEOI11_bal)C++17
0 / 100
957 ms1416 KiB
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define fi first #define se second #define pii pair<int,int> #define pll pair<long long,long long> #define pb push_back #define debug(x) cerr<<#x<<"="<<x<<endl #define pq priority_queue #define inf 1ll<<60 #define rep(i,a,b) for (int i=a;i<(b);i++) #define MP make_pair #define SZ(x) (int(x.size())) #define mod 1000000007 #define ALL(x) x.begin(),x.end() #define endl "\n" void inc(ll &a,ll b) {a=(a+b)%mod;} void dec(ll &a,ll b) {a=(a-b+mod)%mod;} int lowbit(ll x) {return x&(-x);} vector<pair<ll,ll>>alist; long double calc(ll a,ll b){ return a*a/(4*b); } int main() { ios::sync_with_stdio(0); cin.tie(0); ll n;cin>>n; cout<<fixed<<setprecision(10); while(n--){ long double x,r;cin>>x>>r; for(auto p:alist){ r=min(r,calc(x-p.fi,p.se)); } alist.pb(MP(x,r)); cout<<r<<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...