# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
964034 | 2024-04-16T08:27:53 Z | Neco_arc | Balloons (CEOI11_bal) | C++17 | 172 ms | 15328 KB |
#include <bits/stdc++.h> #define ll long long #define all(x) x.begin(), x.end() #define Neco "Balloons" #define resp(x) sort(all(x)), x.resize(unique(all(x)) - x.begin()) #define getbit(x,i) ((x >> i)&1) #define _left id * 2, l, mid #define _right id * 2 + 1, mid + 1, r #define cntbit(x) __builtin_popcountll(x) #define fi(i, a, b) for(int i = a; i <= b; i++) #define fid(i, a, b) for(int i = a; i >= b; i--) #define maxn (int) 2e5 + 7 using namespace std; const ll mod = 1e9 + 7; //972663749 const ll base = 911382323; typedef long double ld; mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()); ll GetRandom(ll l, ll r) { return uniform_int_distribution<ll> (l, r)(rng); } int n; pair<ld, ld> a[maxn]; ld ans[maxn]; int q[maxn], top; void solve() { cin >> n; fi(i, 1, n) cin >> a[i].first >> a[i].second; fi(i, 1, n) { ld R = a[i].second; while(top) { int t = q[top]; ld val = (a[t].first - a[i].first) * (a[t].first - a[i].first) / (4 * ans[t]); R = min(R, val); if(R > ans[t]) --top; else break; } ans[i] = R, q[++top] = i; } fi(i, 1, n) cout << fixed << setprecision(3) << ans[i] << '\n'; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); if(fopen(Neco".inp", "r")) { freopen(Neco".inp", "r", stdin); freopen(Neco".out", "w", stdout); } int nTest = 1; // cin >> nTest; while(nTest--) { solve(); } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 344 KB | 10 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | 2 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | 505 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 604 KB | 2000 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 19 ms | 1684 KB | 20000 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 40 ms | 3920 KB | 50000 numbers |
2 | Correct | 38 ms | 4180 KB | 49912 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 84 ms | 7324 KB | 100000 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 105 ms | 8528 KB | 115362 numbers |
2 | Correct | 90 ms | 9268 KB | 119971 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 130 ms | 11344 KB | 154271 numbers |
2 | Correct | 149 ms | 15328 KB | 200000 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 172 ms | 14068 KB | 200000 numbers |
2 | Correct | 149 ms | 15184 KB | 199945 numbers |