标签:
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 737 Accepted Submission(s): 371
Special Judge
#include<iostream> #include<cstdio> #include<cstring> #include<string> #include<cmath> #include<cstdlib> #include<algorithm> using namespace std; int tt,n,a[52]; bool cmp(int x,int y) { return x>y; } int main() { scanf("%d",&tt); while(tt--) { scanf("%d",&n); for(int i=1;i<=n;i++) scanf("%d",&a[i]); sort(a+1,a+1+n,cmp); double ans=0; for(int i=1;i<=n;i++) ans+=pow(0.95,i-1)*a[i]; printf("%.10lf\n",ans); } return 0; }
标签:
原文地址:http://www.cnblogs.com/a972290869/p/4249386.html