# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
495638 | 2021-12-19T16:39:34 Z | keertan | Balloons (CEOI11_bal) | C++17 | 132 ms | 6132 KB |
#include <bits/stdc++.h> using namespace std; //#define int int64_t #define all(x) x.begin(), x.end() #define all1(x) x.rbegin(), x.rend() #define sz(x) (int)(x.size()) const int N = 1e5 + 5, mod = 1e9 + 7; const int64_t N1=1e18; const double eps=1e-11; void solve(){ int n; cin>>n; vector<pair<int,int>> z(n); for (pair<int,int> &it:z){cin>>it.first>>it.second;} stack<pair<double,double>> s; for (int i=0;i<n;i++){ while([&]()->bool{ if (s.empty()){return false;} double x1=s.top().first,y1=s.top().second,x2=z[i].first,y2=z[i].second; double dis=((x2-x1)*(x2-x1))/(4.0*y1); // cerr<<dis<<" "<<i<<"\n"; double ans=min(y1,dis); return ans>=y1; }()){s.pop();} if (!s.empty()){ double x1=s.top().first,y1=s.top().second,x2=z[i].first,y2=z[i].second; double dis=((x2-x1)*(x2-x1))/(4.0*y1); // cerr<<dis<<" "<<i<<"\n"; double ans=min(y1,dis); cout<<fixed<<setprecision(3)<<ans<<"\n"; s.emplace(x2,ans); } else{ cout<<fixed<<setprecision(3)<<z[i].second<<"\n"; s.emplace(z[i]); } } } int32_t main(){ ios::sync_with_stdio(false),cin.tie(nullptr),cout.tie(nullptr); int tq = 1; //cin>>tq; for (;tq;tq--){solve();} }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 208 KB | 10 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 208 KB | 2nd numbers differ - expected: '252735385.4379999936', found: '1000000000.0000000000', error = '747264614.5620000362' |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 208 KB | 6th numbers differ - expected: '213.0000000000', found: '238.0000000000', error = '25.0000000000' |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 336 KB | 4th numbers differ - expected: '117.0000000000', found: '120.0020000000', error = '3.0020000000' |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 13 ms | 828 KB | 9th numbers differ - expected: '202.0000000000', found: '205.0000000000', error = '3.0000000000' |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 33 ms | 1736 KB | 3rd numbers differ - expected: '15396.0000000000', found: '15397.0000000000', error = '1.0000000000' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 67 ms | 3272 KB | 10th numbers differ - expected: '7926.0000000000', found: '7929.0000000000', error = '3.0000000000' |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 78 ms | 3740 KB | 3rd numbers differ - expected: '5055.0000000000', found: '5058.0000000000', error = '3.0000000000' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 104 ms | 5004 KB | 13th numbers differ - expected: '1861.0000000000', found: '1862.0000000000', error = '1.0000000000' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 132 ms | 6132 KB | 9th numbers differ - expected: '2952.0000000000', found: '2954.0000000000', error = '2.0000000000' |
2 | Halted | 0 ms | 0 KB | - |