# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
482368 |
2021-10-24T07:40:00 Z |
Berted |
Balloons (CEOI11_bal) |
C++14 |
|
221 ms |
12140 KB |
#include <iostream>
#include <stack>
#include <iomanip>
#include <vector>
#define ld long double
#define pdd pair<ld, ld>
#define fst first
#define snd second
using namespace std;
int N;
vector<pdd> S;
int main()
{
ios :: sync_with_stdio(0); cin.tie(0);
cin >> N;
for (int i = 0; i < N; i++)
{
ld X, R; cin >> X >> R;
while (S.size() > 1)
{
if ((X - S.back().fst) * (X - S.back().fst)/ (4 * S.back().snd) >= (X - S[S.size() - 2].fst) * (X - S[S.size() - 2].fst) / (4 * S[S.size() - 2].snd)) {S.pop_back();}
else {break;}
}
if (S.size()) {R = min(R, (X - S.back().fst) * (X - S.back().fst)/ (4 * S.back().snd));}
S.push_back({X, R});
cout << fixed << setprecision(3) << R << "\n";
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
10 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
2 numbers |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
332 KB |
17th numbers differ - expected: '213.0000000000', found: '234.0000000000', error = '21.0000000000' |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
452 KB |
504th numbers differ - expected: '160.9360000000', found: '163.0000000000', error = '2.0640000000' |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
23 ms |
1868 KB |
653rd numbers differ - expected: '96.2810000000', found: '123.0000000000', error = '26.7190000000' |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
61 ms |
3572 KB |
14174th numbers differ - expected: '0.7720000000', found: '1.3710000000', error = '0.5990000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
113 ms |
6408 KB |
7447th numbers differ - expected: '0.9750000000', found: '8.0000000000', error = '7.0250000000' |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
132 ms |
6528 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 |
174 ms |
11976 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 |
221 ms |
12140 KB |
2735th numbers differ - expected: '1883.4630000000', found: '1899.0000000000', error = '15.5370000000' |
2 |
Halted |
0 ms |
0 KB |
- |