Submission #464025

# Submission time Handle Problem Language Result Execution time Memory
464025 2021-08-12T09:02:02 Z dutch Balloons (CEOI11_bal) C++17
20 / 100
217 ms 6316 KB
#include <bits/stdc++.h>
using namespace std;

struct readInt{
	readInt& operator>>(int &I){
		char J = I = 0;
		while(J < 48) J = getchar_unlocked();
		while(J > 47) I = I * 10 + J - 48, J = getchar_unlocked();
		return *this;
	}
#define cin __read__
} __read__;

const int LIM = 2e5;

int n, x[LIM], st[LIM+1], *p = st;
double y[LIM];

signed main(){
	cin >> n;
	
	cout << fixed << setprecision(4);

	for(int i=0, j; i<n; ++i){
		cin >> x[i] >> j; y[i] = j;
		while(p != st){
			y[i] = min(y[i], ((x[*p]-x[i]) * (x[*p]-x[i]))/(4.0*y[*p]));
			if(y[*p] < y[i]) --p;
			else break;
		}
		cout << y[*(++p) = i] << '\n';
	}
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB 10 numbers
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB 2nd numbers differ - expected: '252735385.4379999936', found: '0.9334000000', error = '252735384.5045999885'
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB 505 numbers
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 332 KB 506th numbers differ - expected: '365.0000000000', found: '-2481854.0646000002', error = '2482219.0646000002'
# Verdict Execution time Memory Grader output
1 Incorrect 22 ms 912 KB 655th numbers differ - expected: '591.0000000000', found: '-2402336.3031000001', error = '2402927.3031000001'
# Verdict Execution time Memory Grader output
1 Incorrect 49 ms 1472 KB 250th numbers differ - expected: '15134.0000000000', found: '-10429.6655000000', error = '25563.6655000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 98 ms 2996 KB 7234th numbers differ - expected: '7160.0000000000', found: '-2398141.9989000000', error = '2405301.9989000000'
# Verdict Execution time Memory Grader output
1 Incorrect 115 ms 3328 KB 4643rd numbers differ - expected: '2427.0000000000', found: '-2355611.7017999999', error = '2358038.7017999999'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 155 ms 4456 KB 1734th numbers differ - expected: '1856.0220000000', found: '-2324667.3864000002', error = '2326523.4084000001'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 217 ms 6316 KB 2723rd numbers differ - expected: '859.0470000000', found: '-2333711.4844999998', error = '2334570.5314999996'
2 Halted 0 ms 0 KB -