# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1109179 | 2024-11-06T07:15:30 Z | dzhoz0 | Balloons (CEOI11_bal) | C++17 | 151 ms | 11344 KB |
/* ghmt the cutie :3 UwU */ #include <bits/stdc++.h> #include <iomanip> using namespace std; #define int long long #define INF 1e18 #define f first #define s second #define pii pair<int, int> #define vi vector<int> const int MOD = 1'000'000'000 + 7; void setIO(string name = "") { ios_base::sync_with_stdio(0); cin.tie(0), cout.tie(0); #ifdef LOCAL freopen("inp.txt", "r", stdin); freopen("out.txt", "w", stdout); #else if (!name.empty()) { freopen((name + ".INP").c_str(), "r", stdin); freopen((name + ".OUT").c_str(), "w", stdout); } #endif } const int MAXN = 2e5; int n; double x[MAXN + 5], r[MAXN + 5]; double res[MAXN + 5]; double sq(long double x) { return x * x; } void solve() { cin >> n; for(int i = 1; i <= n; i++) { cin >> x[i] >> r[i]; } vi st; for(int i = 1; i <= n; i++) { // cout << st << '\n'; while(!st.empty()) { r[i] = min(r[i], sq(x[i] - x[st.back()]) / (4 * r[st.back()])); if(r[i] >= r[st.back()]) st.pop_back(); else break; } st.push_back(i); } cout << fixed << setprecision(9); for(int i = 1; i <= n; i++) cout << r[i] << '\n'; } signed main() { setIO(); int t = 1; // cin >> t; while (t--) solve(); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 4432 KB | 10 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 4432 KB | 2 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 4432 KB | 505 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 4432 KB | 2000 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 15 ms | 4940 KB | 20000 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 37 ms | 6224 KB | 50000 numbers |
2 | Correct | 33 ms | 6052 KB | 49912 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 73 ms | 7496 KB | 100000 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 86 ms | 8008 KB | 115362 numbers |
2 | Correct | 87 ms | 8252 KB | 119971 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 119 ms | 9160 KB | 154271 numbers |
2 | Correct | 134 ms | 11344 KB | 200000 numbers |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 151 ms | 10312 KB | 200000 numbers |
2 | Correct | 128 ms | 11200 KB | 199945 numbers |