Submission #835346

# Submission time Handle Problem Language Result Execution time Memory
835346 2023-08-23T13:35:59 Z Dyzio96 Balloons (CEOI11_bal) C++14
0 / 100
108 ms 2976 KB
#include <bits/stdc++.h>
using namespace std;
const int M = 2e5 +7;
int n;

// pair<int,int> baloon[M];


int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cin >> n;
	vector<double> radius;
	stack<pair<double ,double >> s;
	// s.push({baloon[0].first,baloon[0].second});
	double  max_r;
	for (int i = 0;  i <n;i++){
		double a, x;
		cin >> a >> x;
		max_r = x;
		// max_r= ((a - s.top().first) *   (a - s.top().first))/4 * s.top().second;
		while(!s.empty()){
			double  last_r= ((a - s.top().first) *   (a - s.top().first))/4 * s.top().second;
			max_r = max(last_r,max_r);
			if ( max_r > s.top().second){
				s.pop();
				continue;
			}
			else {
				break;
			}
			s.push({a,max_r});
			radius[i] = max_r;
		}
	}
	for (double &r: radius) {cout << r << '\n';}
	
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Unexpected end of file - double expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Unexpected end of file - double expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Unexpected end of file - double expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 332 KB Unexpected end of file - double expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 468 KB Unexpected end of file - double expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 17 ms 944 KB Unexpected end of file - double expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 40 ms 1708 KB Unexpected end of file - double expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 40 ms 1996 KB Unexpected end of file - double expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 52 ms 2460 KB Unexpected end of file - double expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 108 ms 2976 KB Unexpected end of file - double expected
2 Halted 0 ms 0 KB -