| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1337481 | JungPS | Balloons (CEOI11_bal) | C++20 | 227 ms | 7696 KiB |
#include<bits/stdc++.h>
using namespace std;
pair<int,long double> dat[200007];
stack<pair<int,long double>> st; //top = low
#define position first
#define radius second
void loop(int tar){
pair<int,long double> cl2,cl1;
while(true){
if(st.size()>=2){
cl1=st.top(); st.pop();
long double t1=(tar-cl1.first)*(tar-cl1.first)/cl1.second;
cl2=st.top(); st.pop();
long double t2=(tar-cl2.first)*(tar-cl2.first)/cl2.second;
if(t2>t1){
st.push(cl1);
}
else{
st.push(cl2);
break;
}
}
else break;
}
}
signed main(){
ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
int n; cin >> n;
for(int i=1;i<=n;++i) cin >> dat[i].first >> dat[i].second;
for(int i=1;i<=n;++i){
int pos=dat[i].first;
loop(pos);
long double rad;
if(!st.empty()){
rad=(dat[i].first-st.top().first+0.00)*(dat[i].first-st.top().first+0.00)/st.top().second/4;
rad=min(rad,(long double)dat[i].second);
}
else rad=dat[i].second;
cout << rad << endl;
st.push({pos,rad});
}
}| # | 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... | ||||
