2013ACM/ICPC亚洲区南京站现场赛——题目重现

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

签到题,输入两个表,注意细心点就行了。

 1 #include<cstdio>
 2 #include<cstring>
 3 const int M=16;
 4 char s[M],cp[M][M]={"A","A-","B+","B","B-","C+","C","C-","D","D-","F"};
 5 double si[]={4,3.7,3.3,3,2.7,2.3,2,1.7,1.3,1.0,0};
 6 int main(){
 7     int n;
 8     while(~scanf("%d",&n)){
 9         double ss=0;
10         int sc=0,c;
11         while(n--){
12             scanf("%d%s",&c,s);
13             for(int i=0;i<11;i++){
14                 if(!strcmp(cp[i],s)){
15                     ss+=si[i]*c;
16                     sc+=c;
17                     break;
18                 }
19             }
20         }
21         if(!sc){
22             puts("0.00");
23             continue;
24         }
25         printf("%.2f\n",ss/sc);
26     }
27     return 0;
28 }

end

时间: 2025-01-02 13:33:44

2013ACM/ICPC亚洲区南京站现场赛——题目重现的相关文章

hdu-4810 Wall Painting 2013ACM/ICPC亚洲区南京站现场赛

题目链接http://acm.hdu.edu.cn/showproblem.php?pid=4810 解题思路: 记录下每个数的各个位上1个数的和,根据题意,异或要产生数值,必须是取基数个1,通过组合数学的方法,比如要在6个1里面取三个1,则取得方法有C(6,3),那么如何可以快速取得C(6,3)呢?通过杨辉三角形打表即可 #include <iostream> #include <cstdio> #include <cstring> using namespace s

2014ACM/ICPC亚洲区鞍山赛区现场赛——题目重现

2014ACM/ICPC亚洲区鞍山赛区现场赛--题目重现 题目链接 5小时内就搞了5题B.C.D.E,I. H题想到要打表搞了,可惜时间不够,后面打出表试了几下过了- - K题过的人也比较多,感觉是个几何旋转+ploya,但是几何实在不行没什么想法 B:这题就是一个大模拟,直接数组去模拟即可,注意细节就能过 C:类似大白上一题红蓝三角形的, 每个数字找一个互质和一个不互质个数,除掉重复就直接除2,然后总的C(n, 3)减去即可,问题在怎么处理一个数字互质和不互质的,其实只要处理出不互质的即可,这

2016 ACM/ICPC亚洲区青岛站现场赛(部分题解)

摘要 本文主要列举并求解了2016 ACM/ICPC亚洲区青岛站现场赛的部分真题,着重介绍了各个题目的解题思路,结合详细的AC代码,意在熟悉青岛赛区的出题策略,以备战2018青岛站现场赛. HDU 5984 Pocky 题意 给出一根棒子(可以吃的)的长度x和切割过程中不能小于的长度d,每次随机的选取一个位置切开,吃掉左边的一半,对右边的棒子同样操作,直至剩余的长度不大于d时停止.现在给出x和d,问切割次数的数学期望是多少. 解题思路 当看到第二个样例2 1时,结果是1.693147,联想到ln

2014ACM/ICPC亚洲区西安站现场赛 F color(二项式反演)

题意:小球排成一排,从m种颜色中选取k种颜色给n个球上色,要求相邻的球的颜色不同,求可行的方案数,答案模1e9+7.T组数据,1<= n, m <= 1e9, 1 <= k <= 1e6, k <= n, m 分析: a(k)表示用不超过k种颜色染n个位置,两两相邻颜色不相同的总数,很简单a(k)=k(n-1)^(k-1) b(k)表示恰好用k种颜色 很显然a(k)=ΣC(k,i)b(i),我们知道a,想知道b,这里就用到二项式反演 那么b(k)=ΣC(k,i)*i*(-1)

2014ACM/ICPC亚洲区鞍山赛区现场赛1009Osu!

鞍山的签到题,求两点之间的距离除以时间的最大值.直接暴力过的. A - Osu! Time Limit:1000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 5078 Appoint description:  System Crawler  (2014-10-22) Description Osu! is a very popular music game. B

hdu5512 Pagodas(2015ACM/ICPC亚洲区沈阳站-重现赛(感谢东北大学) )

Pagodas Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 14 Accepted Submission(s): 13 Problem Description n pagodas were standing erect in Hong Jue Si between the Niushou Mountain and the Yuntai M

2017ACM/ICPC亚洲区沈阳站-重现赛(感谢东北大学)HDU6225.Little Boxes-大数加法

整理代码... Little Boxes Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 2304    Accepted Submission(s): 818 Problem Description Little boxes on the hillside.Little boxes made of ticky-tacky.Littl

HDU 5950 Recursive sequence 【递推+矩阵快速幂】 (2016ACM/ICPC亚洲区沈阳站)

Recursive sequence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 249    Accepted Submission(s): 140 Problem Description Farmer John likes to play mathematics games with his N cows. Recently, t

HDU 5976 Detachment 【贪心】 (2016ACM/ICPC亚洲区大连站)

Detachment Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 570    Accepted Submission(s): 192 Problem Description In a highly developed alien society, the habitats are almost infinite dimensiona