| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1063643 | daviedu | Balloons (CEOI11_bal) | C++17 | 111 ms | 14928 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(0); cin.tie(0)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define ll long long
#define ld long double
struct P{
ll x, y;
};
void dbg_out() { cerr << endl; }
template <typename H, typename... T>
void dbg_out(H h, T... t) { cerr << ' ' << h; dbg_out(t...); }
#define dbg(...) { cerr << #__VA_ARGS__ << ':'; dbg_out(__VA_ARGS__); }
ld max_r(ll a, ll b, ld R){
return (a-b)*(a-b) / (4*R);
}
signed main(){
fastio;
int n;
cin >> n;
vector<pair<int, ld>> arr (n);
for (int i=0; i<n; i++){
cin >> arr[i].first >> arr[i].second;
}
vector<ld> ans (n);
stack<int> can_touch;
for (int i=0; i<n; i++){
auto [x, r] = arr[i];
ld best=r;
while (!can_touch.empty()){
int X = arr[can_touch.top()].first;
ld R = ans[can_touch.top()];
// touches
if (best >= max_r(x, X, R)) best = max_r(x, X, R);
if (best >= R) can_touch.pop();
else break;
}
ans[i] = best;
can_touch.push(i);
}
cout << fixed << setprecision(3);
for (int i=0; i<n; i++) cout << ans[i] << ' ';
cout << '\n';
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
