Submission #720548

# Submission time Handle Problem Language Result Execution time Memory
720548 2023-04-08T13:08:32 Z mariowong Balloons (CEOI11_bal) C++14
20 / 100
482 ms 4488 KB
#include <bits/stdc++.h>
using namespace std;


int main(){
	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	long double gx,gr,lx,lr;
	for (int i=1;i<=n;i++){
		long double x,r;
		cin >> x >> r;
		if (i == 1){
			cout << setprecision(3) << fixed << r << "\n";
			gx=lx=x;
			gr=lr=r;
		}
		else
		{
			if ((gx-x)*(gx-x)*lr >= gr*(lx-x)*(lx-x)) gx=lx,gr=lr;
			cout << setprecision(3) << fixed << min((x-gx)*(x-gx)/4.0/gr,r) << "\n";
			lx=x; lr=min((x-gx)*(x-gx)/4.0/gr,r);
		}
	}
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB 10 numbers
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB 2 numbers
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 212 KB 17th numbers differ - expected: '213.0000000000', found: '234.0000000000', error = '21.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 340 KB 114th numbers differ - expected: '39.0180000000', found: '56.0000000000', error = '16.9820000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 55 ms 604 KB 196th numbers differ - expected: '100.7250000000', found: '111.0000000000', error = '10.2750000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 130 ms 1364 KB 14045th numbers differ - expected: '15399.0000000000', found: '15419.0000000000', error = '20.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 258 ms 2632 KB 7310th numbers differ - expected: '7939.8510000000', found: '7941.0000000000', error = '1.1490000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 293 ms 3012 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 369 ms 3868 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 482 ms 4488 KB 2723rd numbers differ - expected: '859.0470000000', found: '862.0000000000', error = '2.9530000000'
2 Halted 0 ms 0 KB -