http://acm.hust.edu.cn/vjudge/contest/view.action?cid=102271#problem/B

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 100
0 1 2 3 4
1 0

Output

4900

Input

119 119 119 119 119
0 0 0 0 0
10 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.

简单模拟。

#include<stdio.h>
#include<algorithm>
#define maxx 10
using namespace std;
long long hu,hs;
double x[maxx]={, , , , },w[maxx],score,m[maxx];
int main(){
for(int i=;i<;i++)
scanf("%lf",&m[i]);
for(int i=;i<;i++)
scanf("%lf",&w[i]);
scanf("%lld%lld",&hs,&hu);
for(int i=;i<;i++)
score+=max(0.3*x[i],(-m[i]/)*x[i]-*w[i]);
score+=*hs-*hu;
printf("%.0f\n",score);//.0f实际上是四舍五入,但是题目保证了答案一定是整数
return ;
}

或者

#include<stdio.h>
#include<algorithm>
#define maxx 10
using namespace std;
long long x[maxx]={, , , ,},w[maxx],score,m[maxx],hu,hs;
int main(){
for(int i=;i<;i++)
scanf("%lld",&m[i]);
for(int i=;i<;i++)
scanf("%ldd",&w[i]);
scanf("%lld%lld",&hs,&hu);
for(int i=;i<;i++)
score+=max(x[i]*/,(x[i]-m[i]*x[i]/)-*w[i]);
score+=*hs-*hu;
printf("%lld\n",score);
return ;
}

  

【 CodeForces 604A】B - 特别水的题2-Uncowed Forces的更多相关文章

  1. 【CodeForces 596A】E - 特别水的题5-Wilbur and Swimming Pool

    Description After making bad dives into swimming pools, Wilbur wants to build a swimming pool in the ...

  2. 【CodeForces 599A】D - 特别水的题4- Patrick and Shopping

    Description  meter long road between his house and the first shop and a d2 meter long road between h ...

  3. 【CodeForces 606A】A -特别水的题1-Magic Spheres

    http://acm.hust.edu.cn/vjudge/contest/view.action?cid=102271#problem/A Description Carl is a beginne ...

  4. 【CodeForces 602A】C - 特别水的题3-Two Bases

    http://acm.hust.edu.cn/vjudge/contest/view.action?cid=102271#problem/C Description After seeing the ...

  5. Codeforces Round #334 (Div. 2) A. Uncowed Forces 水题

    A. Uncowed Forces Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/604/pro ...

  6. Codeforces Round #378 (Div. 2) D题(data structure)解题报告

    题目地址 先简单的总结一下这次CF,前两道题非常的水,可是第一题又是因为自己想的不够周到而被Hack了一次(或许也应该感谢这个hack我的人,使我没有最后在赛后测试中WA).做到C题时看到题目情况非常 ...

  7. CodeForces.158A Next Round (水模拟)

    CodeForces.158A Next Round (水模拟) 题意分析 校赛水题的英文版,坑点就是要求为正数. 代码总览 #include <iostream> #include &l ...

  8. Codeforces Round #612 (Div. 2) 前四题题解

    这场比赛的出题人挺有意思,全部magic成了青色. 还有题目中的图片特别有趣. 晚上没打,开virtual contest打的,就会前三道,我太菜了. 最后看着题解补了第四道. 比赛传送门 A. An ...

  9. Codeforces 828B Black Square(简单题)

    Codeforces 828B Black Square(简单题) Description Polycarp has a checkered sheet of paper of size n × m. ...

随机推荐

  1. Spring 一二事(1)

    简单介绍一下spring,一方面带新手入入门,一方面自己也重温一下第一个小工厂先暂时不用maven,下一个会用maven来来配置 jar包只需要一个,spring版本为2.5(暂时为2.5,后续更新, ...

  2. sqlzoo.net刷题

    只发后面提升题目的题解,前面的太简单,写下来也没有意义 12.查找尤金•奧尼爾EUGENE O'NEILL得獎的所有細節 Find all details of the prize won by EU ...

  3. 013医疗项目-模块一:加入工具类ResultUtil

    这篇文章要做的就是优化,封装.把之前的代码尽量封装进类,并且不要硬编码. 在UserServiceimpl中的insertSysuser()函数之前是这么写的: ResultInfo resultIn ...

  4. 给 IIS Express 配置虚拟目录

    使用 vs2015 打开旧项目,之前使用 iis 配置站点,然后在 vs 中附加 w3wp.exe 进行开发和调试的. 由于种种原因 iis 上配置站点各种失败. 之后发现,其实在 vs2015 中按 ...

  5. mac基本用法

    1.屏幕截图 command + shift + 4 2.切换到桌面 command + f3 3.右击 双支轻拍 4.彻底退出窗口 command + q 5.关闭窗口 cmd + w 6.隐藏窗口 ...

  6. ZooKeeper学习第七期--ZooKeeper一致性原理

    一.ZooKeeper 的实现 1.1 ZooKeeper处理单点故障 我们知道可以通过ZooKeeper对分布式系统进行Master选举,来解决分布式系统的单点故障,如图所示. 图 1.1 ZooK ...

  7. LINQ to Entities 查询语法

    转自: http://www.cnblogs.com/asingna/archive/2013/01/28/2879595.html 实体框架(Entity Framework )是 ADO.NET  ...

  8. ScrollView 简单出错

    ScrollView can host only one direct child 主要是ScrollView内部只能有一个子元素,即不能并列两个子元素,所以需要把所有的子元素放到一个LinearLa ...

  9. struct2cell

    函数功能:把结构体转换为元胞数组. 语法格式: c = struct2cell(s) 如果s是m*n(m行n列)的二维的结构体数组,每个结构体含有p个域,则转换得到一个p*m*n的元胞数组c. 如果s ...

  10. 使用JQuery能做什么(zz)

    jQuery库为Web脚本编程提供了通用(跨浏览器)的抽象层,使得它几乎适用于任何脚本编程的情形.jQuery通常能为我们提供以下功能: 1.方便快捷获取DOM元素 如果使用纯JavaScript的方 ...