Submission #469305

# Submission time Handle Problem Language Result Execution time Memory
469305 2021-08-31T11:41:05 Z Autron Balloons (CEOI11_bal) C++14
10 / 100
773 ms 2992 KB
#include <bits/stdc++.h>
using namespace std;



int main(){
	int n;
	cin>>n;
	stack<pair<int, int>> s;
	for(int i=1;i<=n;++i){
		double x, r;
		cin>>x>>r;
		while(!s.empty()){
			double x1, r1;
			tie(x1, r1)=s.top();
			double val=((x1-x)*(x1-x))/(4*r1);
			r=min(r, val);
			if(r>=r1) s.pop();
			else break;
		}
		s.push({x, r});
		cout<<fixed<<setprecision(9)<<r<<"\n";
	}
	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB 8th numbers differ - expected: '8.7410000000', found: '9.0909090910', error = '0.3499090910'
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB 2 numbers
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 204 KB 13th numbers differ - expected: '2.3960000000', found: '2.4500000000', error = '0.0540000000'
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 308 KB 3rd numbers differ - expected: '121.0000000000', found: '121.0020491800', error = '0.0020491800'
# Verdict Execution time Memory Grader output
1 Incorrect 75 ms 500 KB 71st numbers differ - expected: '136.0000000000', found: '136.0018248180', error = '0.0018248180'
# Verdict Execution time Memory Grader output
1 Incorrect 188 ms 968 KB 254th numbers differ - expected: '15129.9990000000', found: '15130.0013391970', error = '0.0023391970'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 387 ms 1732 KB 286th numbers differ - expected: '7633.9990000000', found: '7634.0008192420', error = '0.0018192420'
# Verdict Execution time Memory Grader output
1 Incorrect 475 ms 2068 KB 512th numbers differ - expected: '4502.9990000000', found: '4503.0045060080', error = '0.0055060080'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 658 ms 2660 KB 165th numbers differ - expected: '1698.9980000000', found: '1699.0001472320', error = '0.0021472320'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 773 ms 2992 KB 249th numbers differ - expected: '2683.0090000000', found: '2683.0112286560', error = '0.0022286560'
2 Halted 0 ms 0 KB -