Submission #641299

# Submission time Handle Problem Language Result Execution time Memory
641299 2022-09-16T10:27:11 Z Trisanu_Das Balloons (CEOI11_bal) C++17
100 / 100
556 ms 8808 KB
#include <bits/stdc++.h>
using namespace std;
 
int main(){
	int n; cin >> n;
	int x[n], st[n+1], *p = st;
	double r[n];
 
	for(int i=0; i<n; ++i){
		cin >> x[i] >> r[i];
		while(p != st){
			r[i] = min(r[i], pow(x[*p]-x[i], 2)/(4.0*r[*p]));
			if(r[*p] < r[i]) --p;
			else break;
		}
		*(++p) = i;
		cout << fixed << setprecision(4) << r[i] << '\n';
	}
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB 10 numbers
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB 2 numbers
# Verdict Execution time Memory Grader output
1 Correct 2 ms 212 KB 505 numbers
# Verdict Execution time Memory Grader output
1 Correct 5 ms 340 KB 2000 numbers
# Verdict Execution time Memory Grader output
1 Correct 54 ms 984 KB 20000 numbers
# Verdict Execution time Memory Grader output
1 Correct 156 ms 2124 KB 50000 numbers
2 Correct 145 ms 2276 KB 49912 numbers
# Verdict Execution time Memory Grader output
1 Correct 278 ms 4224 KB 100000 numbers
# Verdict Execution time Memory Grader output
1 Correct 318 ms 4892 KB 115362 numbers
2 Correct 328 ms 5408 KB 119971 numbers
# Verdict Execution time Memory Grader output
1 Correct 443 ms 6364 KB 154271 numbers
2 Correct 545 ms 8688 KB 200000 numbers
# Verdict Execution time Memory Grader output
1 Correct 556 ms 7872 KB 200000 numbers
2 Correct 550 ms 8808 KB 199945 numbers