codeforces 604A Uncowed Forces
2015-12-02 15:29
106 查看
A. Uncowed Forces
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 m but made w wrong submissions, then his score on that problem is
![](http://codeforces.com/predownloaded/d6/7f/d67fcf29c2911addc12151730c2edc148d49e425.png)
. 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 m1, m2, m3, m4, m5, 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 w1, w2, w3, w4, w5, 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 test(s)
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
Note
In the second sample, Kevin takes 119 minutes on all of the problems. Therefore, he gets
![](http://codeforces.com/predownloaded/0e/49/0e49cb6d40f25167bc56beffa082e8e4a70e0b4e.png)
of the points on each problem. So his score from solving problems is
![](http://codeforces.com/predownloaded/68/eb/68eb1da869a3d1ab583bcc170730a2e00e4700ba.png)
. Adding in 10·100 = 1000 points from hacks, his total score becomes 3930 + 1000 = 4930.
#include<cstdio> #include<iostream> #include<vector> #include<cmath> #include<queue> #include<string> #include<map> #include<cstring> #include<algorithm> using namespace std; typedef long long ll; typedef unsigned long long ull; struct submission { int t; int wa; int sc; }p[5]; int main() { int shack,fhack; for(int i=0;i<5;i++) { scanf("%d",&p[i].t); p[i].sc=500*(i+1); } for(int i=0;i<5;i++) scanf("%d",&p[i].wa); scanf("%d %d",&shack,&fhack); int sum=0; for(int i=0;i<5;i++) sum+=max(0.3*p[i].sc+0.5,(1-p[i].t*1.0/250)*p[i].sc-50*p[i].wa+0.5); sum+=shack*100,sum-=fhack*50; printf("%d\n",sum); return 0; }
相关文章推荐
- Linux信号基础
- easyui datagrid 去掉 全选checkbox
- 从头认识java-11.4 正则表达式(3)-Pattern和Matcher
- rysnc搭建
- js文本框输入内容智能提示效果
- Redis操作命令总结
- 【Leetcode】Move Zeroes
- Linux进程关系
- Linux用户与“最小权限”原则
- 冒泡算法和简易桶排序算法实现
- jquery文本闪烁
- matlab绘制概率分布图形
- 一招教你如何搜索国内各大网盘资源
- 关于PopupWindow的简单说明
- 在MyEclipse中如何将Java Project转换成Java Web Project
- 数据结构 字符串的长度
- NET 自带IOC容器MEF指初体验
- 解决ajax跨域问题
- 关于oracle采用pivot函数列转行后一些列的值为null处理
- 关于审批流程的控制方法 小议