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

记得排序后输出

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>
using namespace std; const int N = 55;
int t, n, a[N]; int main() {
scanf("%d", &t);
while (t--) {
scanf("%d", &n);
for (int i = 0; i < n; i++)
scanf("%d", &a[i]);
sort(a, a + n);
double ans = 0;
for (int i = n - 1; i >= 0; i--) {
ans += pow(0.95, n - 1 - i) * a[i];
}
printf("%.10lf\n", ans);
}
return 0;
}

hdu 5003 模拟水题的更多相关文章

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

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

  2. hdu 4891 模拟水题

    http://acm.hdu.edu.cn/showproblem.php?pid=4891 给出一个文本,问说有多少种理解方式. 1. $$中间的,(s1+1) * (s2+1) * ...*(sn ...

  3. HDOJ 2317. Nasty Hacks 模拟水题

    Nasty Hacks Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Tota ...

  4. POJ 2014:Flow Layout 模拟水题

    Flow Layout Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 3091   Accepted: 2148 Descr ...

  5. hdu 5210 delete 水题

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

  6. hdu 1251 (Trie水题)

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

  7. hdu 5083 有坑+字符串模拟水题

    http://acm.hdu.edu.cn/showproblem.php?pid=5083 机器码和操作互相转化 注意SET还要判断末5位不为0输出Error #pragma comment(lin ...

  8. HDU 6213 Chinese Zodiac 【模拟/水题/生肖】

    Problem Description The Chinese Zodiac, known as Sheng Xiao, is based on a twelve-year cycle, each y ...

  9. HDU 5703 Desert 水题 找规律

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

随机推荐

  1. python 本地变量和全局变量 locals() globals() global nonlocal 闭包 以及和 scala 闭包的区别

    最近看 scala ,看到了它的作用域,特此回顾一下python的变量作用域问题. A = 10 B = 100 print A #10 print globals() #{'A': 10, 'B': ...

  2. cmd enabledelayedexpansion

    先来说说变量延迟扩展吧.当然,放狗一搜,就能看到满天飞的关于变量延迟扩展的文章,所以,我这里就简单介绍一下.先来看一段批处理: set str=test if %str%==test ( set st ...

  3. Enterprise Library 企业库

    微软企业库,提供了一套日志,缓存等功能的库.可以通过NuGet安装.

  4. sql:查询课程号'0312091006'成绩排名第5到第10之间的学生学号

    select top 6 sno from (select top 10 sno,mark from student_Coursewhere ccno='0312091006' order by ma ...

  5. 139. Word Break (String; DP)

    Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separa ...

  6. 84. Largest Rectangle in Histogram (Array, Stack; DP)

    Given n non-negative integers representing the histogram's bar height where the width of each bar is ...

  7. 有几个Pass,对象就会绘制几次

    在每个SubShader内部可以包含多个,至少一个Pass.有几个Pass,对象就会绘制几次.在编写时我们应该尽量控制Pass的数量. 在Pass中包含Cg/HLSL程序片段,在其中编写vertex ...

  8. LSTM Accuracy

    Training iter #1: Batch Loss = 1.234543, Accuracy = 0.29866665601730347PERFORMANCE ON TEST SET: Batc ...

  9. runtime - 2 - 使用私有方法

    1. 创建 一个person类, 有对象方法, 私有化方法 2. 在h 文件里面 - (void)eat; //- (void)run:(NSInteger)metre; 3. 在m文件里面 -(vo ...

  10. ajax原理以及优缺点(转)

    1.ajax技术的背景不可否认,ajax技术的流行得益于google的大力推广,正是由于google earth.google suggest以及gmail等对ajax技术的广泛应用,催生了ajax的 ...