Submission #641298

#TimeUsernameProblemLanguageResultExecution timeMemory
641298Trisanu_DasBalloons (CEOI11_bal)C++17
Compilation error
0 ms0 KiB
#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){
			y[i] = min(y[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';
	}
}

Compilation message (stderr)

bal.cpp: In function 'int main()':
bal.cpp:12:4: error: 'y' was not declared in this scope
   12 |    y[i] = min(y[i], pow(x[*p]-x[i], 2)/(4.0*r[*p]));
      |    ^