제출 #1123492

#제출 시각아이디문제언어결과실행 시간메모리
1123492lsdwpqerBalloons (CEOI11_bal)C++20
10 / 100
437 ms9100 KiB
#include<bits/stdc++.h> using namespace std; #define ll long long int main(){ ll n; cin >> n; double a[n][2]; for(int i = 0;i < n;i++){ cin >> a[i][0]; cin >> a[i][1]; } stack<array<double,2>> x; double res[n]; res[0] = a[0][1]; x.push({a[0][0],a[0][1]}); for(int i = 1;i < n;i++){ array<double,2> p; double b = a[i][1]; while(!x.empty()){ p = x.top(); b = min(b,((a[i][0]-p[0])*(a[i][0]-p[0]))/(4*p[1])); if(p[1] > b){ break; } x.pop(); } res[i] = b; x.push({a[i][0],a[i][1]}); } for(int i = 0;i < n;i++){ cout << fixed << setprecision(3); cout << res[i] << endl; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...