Skip to content

Commit

Permalink
Update Problem B. Lucky Dip(O(nk)).cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
alhasanmridha authored Feb 10, 2019
1 parent 45e1f0e commit 24f5ae3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Kickstart Round A 2018/Problem B. Lucky Dip(O(nk)).cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ int main(){
double v[n];
for(int i=0;i<n;i++)
scanf("%lf",v+i);
double e0=0;
double e=0;
for(int i=0;i<k+1;i++){
double sum=0;
for(int j=0;j<n;j++){
sum = sum + max((double)v[j],e0);
sum = sum + max((double)v[j],e);

}
e0=sum/(double)n;
e=sum/(double)n;
}
cout<<"Case #"<<tc<<": "<<setprecision(7)<<fixed<<e0<<"\n";
cout<<"Case #"<<tc<<": "<<setprecision(7)<<fixed<<e<<"\n";
}
}

0 comments on commit 24f5ae3

Please sign in to comment.