Submission #465428

# Submission time Handle Problem Language Result Execution time Memory
465428 2021-08-16T03:16:48 Z Cxrles Balloons (CEOI11_bal) C++17
0 / 100
135 ms 6084 KB
#include<bits/stdc++.h>
using namespace std;

int main(){
	int n;
	cin>>n;
	vector<pair<long long , long long>> ballons(n+1);
	stack<pair<long double, long double>> s;
	for(int i=1;i<=n;i++){
		cin>>ballons[i].first>> ballons[i].second;
		if(i==1){
			s.push({ballons[i].first,ballons[i].second});
			cout<<fixed<<setprecision(3)<<(long double) ballons[i].second<<endl;
			continue;
		}
		
		while(s.size()){
			auto pi= s.top();
			long double x=ballons[i].first;
			long double r=ballons[i].second;
			r=min(r,(long double)pow((pi.first-x),2)/(4.0*pi.second));
			
			if(r>pi.second){
				s.pop();
			} else{
				s.push({x,r});
				cout<<fixed<<setprecision(3)<<r<<endl;
				break;
			}
		}
	}
	
}
	
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Unexpected end of file - double expected
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Unexpected end of file - double expected
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 204 KB 14th numbers differ - expected: '2.6090000000', found: '7.1410000000', error = '4.5320000000'
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 332 KB Unexpected end of file - double expected
# Verdict Execution time Memory Grader output
1 Incorrect 14 ms 844 KB Unexpected end of file - double expected
# Verdict Execution time Memory Grader output
1 Incorrect 36 ms 1732 KB Unexpected end of file - double expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 76 ms 3252 KB Unexpected end of file - double expected
# Verdict Execution time Memory Grader output
1 Incorrect 84 ms 3776 KB Unexpected end of file - double expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 115 ms 4932 KB Unexpected end of file - double expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 135 ms 6084 KB Unexpected end of file - double expected
2 Halted 0 ms 0 KB -