Submission #464023

# Submission time Handle Problem Language Result Execution time Memory
464023 2021-08-12T08:56:09 Z dutch Balloons (CEOI11_bal) C++17
100 / 100
228 ms 8648 KB
#include <bits/stdc++.h>
using namespace std;

signed main(){
	cin.tie(0)->sync_with_stdio(0);
	int n; cin >> n;
	int x[n], st[n+1], *p = st;
	double y[n];

	for(int i=0; i<n; ++i){
		cin >> x[i] >> y[i];
		while(p != st){
			y[i] = min(y[i], pow(x[*p]-x[i], 2)/(4.0*y[*p]));
			if(y[*p] < y[i]) --p;
			else break;
		}
		*(++p) = i;
		cout << fixed << setprecision(4) << y[i] << '\n';
	}
}
# Verdict Execution time Memory Grader output
1 Correct 1 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 Correct 1 ms 332 KB 505 numbers
# Verdict Execution time Memory Grader output
1 Correct 3 ms 332 KB 2000 numbers
# Verdict Execution time Memory Grader output
1 Correct 23 ms 1032 KB 20000 numbers
# Verdict Execution time Memory Grader output
1 Correct 57 ms 2184 KB 50000 numbers
2 Correct 56 ms 2360 KB 49912 numbers
# Verdict Execution time Memory Grader output
1 Correct 118 ms 4172 KB 100000 numbers
# Verdict Execution time Memory Grader output
1 Correct 142 ms 4896 KB 115362 numbers
2 Correct 129 ms 5276 KB 119971 numbers
# Verdict Execution time Memory Grader output
1 Correct 228 ms 6484 KB 154271 numbers
2 Correct 214 ms 8648 KB 200000 numbers
# Verdict Execution time Memory Grader output
1 Correct 224 ms 7876 KB 200000 numbers
2 Correct 221 ms 8648 KB 199945 numbers