Submission #441008

# Submission time Handle Problem Language Result Execution time Memory
441008 2021-07-03T21:51:58 Z penguinhacker Balloons (CEOI11_bal) C++14
20 / 100
228 ms 8048 KB
#include <bits/stdc++.h>
using namespace std;

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout << fixed << setprecision(3);
	int n;
	cin >> n;
	vector<pair<int, double>> v;
	while(n--) {
		int x;
		double r;
		cin >> x >> r;
		auto d=[x](pair<int, double> p) {
			double dx=x-p.first;
			return dx*dx/(4*p.second);
		};
		while(v.size()>=2&&d(v.end()[-1])>=d(v.end()[-2]))
			v.pop_back();
		double h=v.size()?min(r, d(v.back())):r;
		cout << h << "\n";
		v.emplace_back(x, h);
	}
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB 10 numbers
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB 2 numbers
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 332 KB 17th numbers differ - expected: '213.0000000000', found: '234.0000000000', error = '21.0000000000'
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 332 KB 504th numbers differ - expected: '160.9360000000', found: '163.0000000000', error = '2.0640000000'
# Verdict Execution time Memory Grader output
1 Incorrect 23 ms 1248 KB 653rd numbers differ - expected: '96.2810000000', found: '123.0000000000', error = '26.7190000000'
# Verdict Execution time Memory Grader output
1 Incorrect 57 ms 2540 KB 14174th numbers differ - expected: '0.7720000000', found: '1.3710000000', error = '0.5990000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 141 ms 4324 KB 7447th numbers differ - expected: '0.9750000000', found: '8.0000000000', error = '7.0250000000'
# Verdict Execution time Memory Grader output
1 Incorrect 139 ms 4752 KB 4793rd numbers differ - expected: '0.9540000000', found: '10.6220000000', error = '9.6680000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 180 ms 7860 KB 1734th numbers differ - expected: '1856.0220000000', found: '1865.0000000000', error = '8.9780000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 228 ms 8048 KB 2735th numbers differ - expected: '1883.4630000000', found: '1899.0000000000', error = '15.5370000000'
2 Halted 0 ms 0 KB -