题目链接:

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. 邁向IT專家成功之路的三十則鐵律 鐵律二十九 IT人富足之道-信仰

    天地自然的循環法則,讓每一個人都必須經歷生.老.病.死.喜.怒.哀.樂,然而至始至終無盡的煩惱總是遠多於快樂,因此筆者深信每一個人在一生當中,都必須要有適合自己的正確信仰,他可以在你無法以物質力量來解 ...

  2. 进程间通信IPC、LPC、RPC

    进程间通信(IPC,Inter-Process Communication),指至少两个进程或线程间传送数据或信号的一些技术或方法.进程是计算机系统分配资源的最小单位.每个进程都有自己的一部分独立的系 ...

  3. [Algorithms] Sort an Array with a Nested for Loop using Insertion Sort in JavaScript

    nsertion sort is another sorting algorithm that closely resembles how we might sort items in the phy ...

  4. 使用 sftp 向linux服务器传输文件

    sftp是加密的文件传输. 登陆 sftp name@123.21.331.1 1 2.把本地文件name1传到服务器name2下 put /name1.html /name2/ 1 把服务器name ...

  5. C 标准库 - <setjmp.h>

    C 标准库 - <setjmp.h> 简介 setjmp.h 头文件定义了宏 setjmp().函数 longjmp() 和变量类型 jmp_buf,该变量类型会绕过正常的函数调用和返回规 ...

  6. 综合运用: C++11 多线程下生产者消费者模型详解(转)

    生产者消费者问题是多线程并发中一个非常经典的问题,相信学过操作系统课程的同学都清楚这个问题的根源.本文将就四种情况分析并介绍生产者和消费者问题,它们分别是:单生产者-单消费者模型,单生产者-多消费者模 ...

  7. Sql语言复习

    一.创建数据库 创建和打开数据库 注意一点:在新建数据库的时候,一般放置数据文件与日志文件的位置,需要提前建立文件夹,不然会报错. 一般主数据文件,我们以.mdf结尾,次数据文件用.ndf结尾.对于日 ...

  8. Spring学习资料

    1.马士兵视频 2.SPRING技术内幕__深入解析SPRING架构与设计原理 3.jinnianshilongnian博客 4.Spring实战 (Spring IN Action) 5.官方文档

  9. 线程安全使用(四) [.NET] 简单接入微信公众号开发:实现自动回复 [C#]C#中字符串的操作 自行实现比dotcore/dotnet更方便更高性能的对象二进制序列化 自已动手做高性能消息队列 自行实现高性能MVC WebAPI 面试题随笔 字符串反转

    线程安全使用(四)   这是时隔多年第四篇,主要是因为身在东软受内网限制,好多文章就只好发到东软内部网站,懒的发到外面,现在一点点把在东软写的文章给转移出来. 这里主要讲解下CancellationT ...

  10. leetCode(40):Path Sum

    Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all ...