题目链接:

Osu!

time Limit: 2000/1000 MS (Java/Others)   

 Memory Limit: 65536/65536 K (Java/Others)

Problem Description
 
Osu! is a famous music game that attracts a lot of people. In osu!, there is a performance scoring system, which evaluates your performance. Each song you have played will have a score. And the system will sort all you scores in descending order. After that, the i-th song scored ai will add 0.95^(i-1)*ai to your total score.

Now you are given the task to write a calculator for this system.

 
Input
 
The first line contains an integer T, denoting the number of the test cases.

For each test case, the first line contains an integer n, denoting the number of songs you have played. The second line contains n integers a1, a2, ..., an separated by a single space, denoting the score of each song.

T<=20, n<=50, 1<=ai<=500.

 
Output
 
For each test case, output one line for the answer.

Your answers will be considered correct if its absolute error is smaller than 1e-5.

 
Sample Input
 
1
2
530 478
 
Sample Output
 
984.1000000000
 
题意:
水题不说了;
 
思路:
 
AC代码:
 
#include <bits/stdc++.h>
using namespace std;
const int N=1e6+;
typedef long long ll;
const ll mod=1e9+;
int t,n;
int a[];
int cmp(int x,int y)
{
return x>y;
}
int main()
{
scanf("%d",&t);
while(t--)
{
scanf("%d",&n);
for(int i=;i<=n;i++)
{
scanf("%d",&a[i]);
}
double ans=;
sort(a+,a+n+,cmp);
for(int i=;i<=n;i++)
{
ans+=pow(0.95,i-)*(double)a[i];
}
printf("%.10lf\n",ans); } return ;
}
 

hdu-5003 Osu!(水题)的更多相关文章

  1. hdu 5003 模拟水题

    http://acm.hdu.edu.cn/showproblem.php?pid=5003 记得排序后输出 #include <cstdio> #include <cstring& ...

  2. hdu 5003 模拟水题 (2014鞍山网赛G题)

    你的一系列得分 先降序排列 再按0.95^(i-1)*ai 这个公式计算你的每一个得分 最后求和 Sample Input12530 478Sample Output984.1000000000 # ...

  3. hdu 5210 delete 水题

    Delete Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5210 D ...

  4. HDU 5003 Osu!

    解题思路:水题,不多说. #include<cstdio> #include<cstring> #include<algorithm> #include<cm ...

  5. hdu 1251 (Trie水题)

    统计难题 Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131070/65535 K (Java/Others)Total Submi ...

  6. HDU 5703 Desert 水题 找规律

    已知有n个单位的水,问有几种方式把这些水喝完,每天至少喝1个单位的水,而且每天喝的水的单位为整数.看上去挺复杂要跑循环,但其实上,列举几种情况之后就会发现是找规律的题了= =都是2的n-1次方,而且这 ...

  7. HDU 4493 Tutor 水题的收获。。

    题目: http://acm.hdu.edu.cn/showproblem.php?pid=4493 题意我都不好意思说,就是求12个数的平均数... 但是之所以发博客,显然有值得发的... 这个题最 ...

  8. hdu 4802 GPA 水题

    GPA Time Limit: 20 Sec  Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=4802 Des ...

  9. hdu 4493 Tutor 水题

    Tutor Time Limit: 20 Sec  Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=4493 D ...

随机推荐

  1. 算法题1+2+...+N

    题目:求1+2+-+n,要求不能使用乘除法.for.while.if.else.switch.case等关键字以及条件判断语句(A?B:C). int solve(int n) { int i = 1 ...

  2. 第八讲_图像问答Image Question Answering

    第八讲_图像问答Image Question Answering 课程结构 图像问答的描述 具备一系列AI能力:细分识别,物体检测,动作识别,常识推理,知识库推理..... 先要根据问题,判断什么任务 ...

  3. php程序调试: xdebug的配置

    怎样在phpeclipse中像调试Java程序一样调试php呢? XDebug的版本号非常多,打开http://xdebug.org/index.php.把站点细致看一下,你会发现有句"If ...

  4. redis 在我做的容器中的配置路劲

    配置 /etc/redis/redis.conf 数据库位置 /var/lib/redis/dump.rdb

  5. 指针初始化为NULL的作用

    关于空指针NULL.野指针.通用指针,首先说一下什么是指针,只要明白了指针的含义,你就明白null的含义了. 假设 有语句 int a=10;那么编译器就在内存中开辟1个整型单元存放变量a,我们假设这 ...

  6. Android手机需要安装任务管理软件吗?

    使用android手机的用户可能都安装了任务管理的软件,使用android手机真的有必要安装结束任务的软件吗?大家在使用中也都发现了,很多软件在被结束后,马上就会又出现在任务列表里,或是稍等一会自己也 ...

  7. js 节点操作

    添加和删除节点(HTML 元素). 创建新的 HTML 元素 如需向 HTML DOM 添加新元素,您必须首先创建该元素(元素节点),然后向一个已存在的元素追加该元素. 实例 <div id=& ...

  8. mysql drop table命令使用总结

    drop性能 drop table(innodb引擎) 数量2000w,只需要5m

  9. JavaScript的string方法(demo)

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  10. session写入数据库

    <?php class session { private static $handle = null; private static $ip = null; private static $l ...