2014 ACM/ICPC Asia Regional Anshan Online

默默的签到

 

Osu! http://acm.hdu.edu.cn/showproblem.php?pid=5003

 1 #include<cstdio>
 2 #include<algorithm>
 3 using namespace std;
 4 int a[64];
 5 int main(){
 6     int t,n;
 7     while(~scanf("%d",&t)){
 8         while(t--){
 9             scanf("%d",&n);
10             for(int i=0;i<n;i++){
11                 scanf("%d",&a[i]);
12             }
13             sort(a,a+n);
14             double ans=0,mul=1;
15             for(int i=n-1;i>=0;i--){
16                 ans+=a[i]*mul;
17                 mul*=0.95;
18             }
19             printf("%.10f\n",ans);
20         }
21     }
22     return 0;
23 }
View Code

 

 

end

posted on 2014-09-14 19:12  gaolzzxin  阅读(205)  评论(0编辑  收藏  举报