이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#include <iostream>
#define f first
#define s second
#define pb push_back
typedef long double ld;
using namespace std;
stack<pair<ld,ld>> balon;
int n;
vector<ld> odp;
void spr(ld poz,ld mini){
while(balon.empty()==0){
ld t_poz=balon.top().f,t_s=balon.top().s;
ld curr_s=(poz-t_poz)*(poz-t_poz)/(4*t_s);
mini=min(curr_s,mini);
curr_s=mini;
if(curr_s>t_s)balon.pop();
else {balon.push({poz,curr_s}); break;}
}
odp.pb(mini);
}
int main()
{
cin>>n;
for(int i=0;i<n;i++){ld a,b; cin>>a>>b; if(i)spr(a,b); else {balon.push({a,b}); odp.pb(b);}}
for(auto i : odp)cout<<fixed<<setprecision(3)<<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... |