Submission #1098705

# Submission time Handle Problem Language Result Execution time Memory
1098705 2024-10-09T18:42:51 Z sano Balloons (CEOI11_bal) C++14
30 / 100
197 ms 10524 KB
#include<iostream>
#include<vector>
#include<queue>
#include<deque>
#include<string>
#include<fstream>
#include<algorithm>
#include <iomanip>
#include<map>
#include <set>
#include <unordered_map>
#include <stack>
#include <unordered_set>
#include <cmath>
#define ll long long
#define For(i, n) for(int i = 0; i < (int)n; i++)
#define ffor(i, a, n) for(int i = (int)a; i < (int)n; i++)
#define rfor(i, n) for(int i = (int)n; i >= (int)0; i--)
#define rffor(i, a, n) for(int i = (int)n; i >= (int)a; i--)
#define vec vector
#define ff first
#define ss second
#define pb push_back
#define shit short int
#define pii pair<int, int>
#define NEK 2147483640
#define mod 1000000007
#define mod2 1000000009
#define rsz resize 
#define prv1 43
#define prv2 47
#define D 8

using namespace std;

int main() {
	int n;
	cin >> n;
	vec<long double> x(n), r(n);
	For(i, n) cin >> x[i] >> r[i];
	stack<int> s;
	For(i, n) {
		while (!s.empty()) {
			long double r2 = (x[i] - x[s.top()]) * (x[i] - x[s.top()]) / 4 / r[s.top()];
			r[i] = min(r2, r[i]);
			if (r[i] >= r[s.top()]) s.pop();
			else break;
		}
		s.push(i);
	}
	For(i, n) cout << r[i] << '\n';
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB 10 numbers
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB 1st numbers differ - expected: '247294217.0000000000', found: '247294000.0000000000', error = '217.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB 505 numbers
# Verdict Execution time Memory Grader output
1 Correct 2 ms 536 KB 2000 numbers
# Verdict Execution time Memory Grader output
1 Incorrect 18 ms 1372 KB 2953rd numbers differ - expected: '1030.4380000000', found: '1030.4400000000', error = '0.0020000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 52 ms 2892 KB 251st numbers differ - expected: '15123.0020000000', found: '15123.0000000000', error = '0.0020000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 103 ms 5472 KB 285th numbers differ - expected: '7629.0020000000', found: '7629.0000000000', error = '0.0020000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 114 ms 6228 KB 511th numbers differ - expected: '4494.0050000000', found: '4494.0100000000', error = '0.0050000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 149 ms 8272 KB 164th numbers differ - expected: '1698.0020000000', found: '1698.0000000000', error = '0.0020000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 197 ms 10524 KB 248th numbers differ - expected: '2694.0020000000', found: '2694.0000000000', error = '0.0020000000'
2 Halted 0 ms 0 KB -