334 (Div. 2) A(模拟)

来源:互联网 发布:ntp网络时间服务器 编辑:程序博客网 时间:2024/06/18 08:08

A - Uncowed Forces
Time Limit:1000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u
Submit Status Practice CodeForces 604A

Description

Kevin Sun has just finished competing in Codeforces Round #334! The round was 120 minutes long and featured five problems with maximum point values of 500, 1000, 1500, 2000, and 2500, respectively. Despite the challenging tasks, Kevin was uncowed and bulldozed through all of them, distinguishing himself from the herd as the best cowmputer scientist in all of Bovinia. Kevin knows his submission time for each problem, the number of wrong submissions that he made on each problem, and his total numbers of successful and unsuccessful hacks. Because Codeforces scoring is complicated, Kevin wants you to write a program to compute his final score.

Codeforces scores are computed as follows: If the maximum point value of a problem is x, and Kevin submitted correctly at minute mbut made w wrong submissions, then his score on that problem is . His total score is equal to the sum of his scores for each problem. In addition, Kevin's total score gets increased by 100 points for each successful hack, but gets decreased by 50 points for each unsuccessful hack.

All arithmetic operations are performed with absolute precision and no rounding. It is guaranteed that Kevin's final score is an integer.

Input

The first line of the input contains five space-separated integers m1m2m3m4m5, where mi (0 ≤ mi ≤ 119) is the time of Kevin's last submission for problem i. His last submission is always correct and gets accepted.

The second line contains five space-separated integers w1w2w3w4w5, where wi (0 ≤ wi ≤ 10) is Kevin's number of wrong submissions on problem i.

The last line contains two space-separated integers hs and hu (0 ≤ hs, hu ≤ 20), denoting the Kevin's numbers of successful and unsuccessful hacks, respectively.

Output

Print a single integer, the value of Kevin's final score.

Sample Input

Input
20 40 60 80 1000 1 2 3 41 0
Output
4900
Input
119 119 119 119 1190 0 0 0 010 0
Output
4930

Hint

In the second sample, Kevin takes 119 minutes on all of the problems. Therefore, he gets  of the points on each problem. So his score from solving problems is . Adding in 10·100 = 1000points from hacks, his total score becomes 3930 + 1000 = 4930.


题意:根据一些规则求分数


题解:注意不要挂精度,先用double求和,再取整。


#include<iostream>#include<string>#include<cstdio>#include<algorithm>#include<cstring>using namespace std;int main(){#ifdef CDZSCfreopen("i.txt","r",stdin);#endifint a[]={500,1000,1500,2000,2500};double sum=0;int m[10],w[10],ha,uha;for(int i=0;i<5;i++)scanf("%d",m+i);for(int i=0;i<5;i++)scanf("%d",w+i);scanf("%d%d",&ha,&uha);for(int i=0;i<5;i++){sum+=max(0.3*a[i],((1-m[i]*1.0/250.0)*1.0*a[i]-50*1.0*w[i]));}sum+=ha*100-uha*50;printf("%d\n",int(sum));return 0;}










0 0
原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 拉链拉不合怎么办图解 塑料拉链不顺畅怎么办 隐形拉链不好拉怎么办 房东赶租客走怎么办 南京合租一间怎么办租房补贴 大学登错成绩怎么办 网游停服花了钱怎么办 北斗星x5油耗高怎么办 北斗星空调不凉怎么办 踏板摩托车费油怎么办 lol队友一直送怎么办 电脑信号无连接怎么办 电脑屏不全屏怎么办 电脑桌面不能显示全屏怎么办? 电脑黑屏无信号怎么办 笔记本电脑屏幕不显示怎么办 手机登录认证要怎么办 360手机丢失了怎么办 主播周年庆怎么办 学校选课系统进不去怎么办 选课系统关闭了怎么办 政府工作人员被威胁怎么办 报志愿忘记用户名怎么办 账号密码忘记了怎么办 商盟卡过期了怎么办 香港身份证掉了怎么办 简易注销有异议怎么办 左转红灯直行了怎么办 怀孕初期吃螃蟹怎么办 天下霸图打不过传闻怎么办 怀孕后期阴部痛怎么办 胎儿头大腿短怎么办 孕期大腿根疼怎么办 到工作单位催债怎么办 被讨债公司骚扰怎么办 要债人上门不走怎么办 阴阳师体力满了怎么办 狗吃了糯米怎么办 误给狗狗吃糯米怎么办 脸上长满了斑怎么办 突然满脸爆斑怎么办