| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1330307 | randi_pav | Balloons (CEOI11_bal) | C++17 | 108 ms | 15516 KiB |
#include <bits/stdc++.h>
#include <iomanip>
using namespace std;
#define fastio() ios::sync_with_stdio(false); cin.tie(NULL)
#define ll long long
#define endl '\n'
int main(){
fastio();
int n;
if (!(cin >> n)) return 0;
vector<pair<long long, long double>> v;
for(int i = 0; i < n; i++){
pair<long long, long double> temp;
cin >> temp.first >> temp.second;
v.push_back(temp);
}
stack<pair<long long, long double>> st;
vector<long double> output;
for(int i = 0; i < n; i++){
long double min_ = v[i].second;
while(!st.empty()){
pair<long long, long double> temp = st.top();
long double temp2 = temp.second;
long long dist = v[i].first - temp.first;
long double result = (long double)(1.0 * dist * dist) / (4.0 * temp2);
min_ = min(min_, result);
if(min_ >= temp2) {
st.pop();
} else {
break;
}
}
st.push({v[i].first, min_});
output.push_back(min_);
}
for(int i = 0; i < n; i++){
cout << fixed << setprecision(3) << output[i] << endl;
}
return 0;
}| # | 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... | ||||
