| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1332445 | mrbet | Balloons (CEOI11_bal) | C++17 | 106 ms | 11436 KiB |
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define forr(_a,_b,_c) for(int _a = (_b); _a <= int (_c); ++_a)
#define ford(_a,_b,_c) for(int _a = (_b) + 1; _a --> int (_c);)
#define forf(_a,_b,_c) for(int _a = (_b); _a < int (_c); ++_a)
#define pb push_back
#define fi first
#define se second
#define vi vector
#define all(_v) _v.begin(), _v.end()
#define mask(_x) (1ll << (_x))
#define bit(_x,_y) (((_x) >> (_y)) & 1)
#define file "A"
string yes[2] = {"NO\n","YES\n"};
const ld eps = ld(1e-7);
const ll inf = ll(1e16) + 1;
const ll mod = ll(1e9) + 7;
template<class X, class Y>
inline bool Min(X &x, const Y &y) {
if(x > y) {
x = y;
return true;
}
return false;
}
template<class X, class Y>
inline bool Max(X &x, const Y &y) {
if(x < y) {
x = y;
return true;
}
return false;
}
const int N = 2e5+5;
int n;
pair<ld,ld> a[N];
stack<pair<ld,ld>> st;
ld rad_i[N];
ld calc_dis(pair<ld,ld> a, ld bx) {
return (a.fi- bx) * (a.fi-bx) / (4*a.se);
}
void Mei () {
cin>>n;
forr(i,1,n) cin>>a[i].fi>>a[i].se;
forr(i,1,n) {
ld max_r= a[i].se;
while (st.size()){
auto k= st.top();
ld dis= calc_dis(k,a[i].fi);
max_r=min(max_r,dis);
if (max_r>= k.se) {
st.pop();
continue;
}
else break;
}
st.push({a[i].fi,max_r});
rad_i[i]= max_r;
}
forr(i,1,n) cout<<rad_i[i]<<' ';
}
void precalc() {
}
int main() {
ios_base::sync_with_stdio(false); cin.tie(0);
cout << fixed << setprecision(3);
if (fopen(file".inp","r")) {
freopen(file".inp","r",stdin); freopen(file".out","w",stdout);
}
else if (fopen(file".in","r")) {
freopen(file".in","r",stdin); freopen(file".out","w",stdout);
}
int tc = 1;
// cin >> tc;
precalc();
while(tc--) {
Mei();
}
return 0;
}
// 36
컴파일 시 표준 에러 (stderr) 메시지
| # | 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... | ||||
