【codeforces】Uncowed Forces
来源:互联网 发布:java软件开发简历范文 编辑:程序博客网 时间:2024/06/10 01:56
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 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 Input
20 40 60 80 1000 1 2 3 41 0
4900
119 119 119 119 1190 0 0 0 010 0
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 = 1000 points from hacks, his total score becomes 3930 + 1000 = 4930.
123456789101112131415161718
#include<stdio.h>#include<algorithm>注意数据类型为doubleusing namespace std;int main(){ double c[5]={500, 1000, 1500, 2000,2500},a[5],sum,b[5];__int64 n,m; for(int i=0;i<5;i++) scanf("%lf",&a[i]); for(int i=0;i<5;i++) scanf("%lf",&b[i]); scanf("%I64d%I64d",&n,&m); for(int i=0;i<5;i++) sum+=max(0.3*c[i],(1-a[i]/250)*c[i]-50*b[i]); sum+=100*n-50*m; printf("%.0lf\n",sum); return 0;}
- 【codeforces】Uncowed Forces
- 【codeforces】Uncowed Forces
- codeforces 604A Uncowed Forces
- Uncowed Forces Codeforces Round #334
- 【CodeForces】[604A]Uncowed Forces
- CodeForces 604A Uncowed Forces
- CodeForces 604A Uncowed Forces
- CodeForces】604A - Uncowed Forces
- 【Codeforces 604A】Uncowed Forces
- 【CodeForces】604A - Uncowed Forces(水)
- 【codeforces】-604A-Uncowed Forces(水)
- 【51.27%】【codeforces 604A】Uncowed Forces
- CodeForces 604 A.Uncowed Forces(水~)
- Uncowed Forces
- Uncowed Forces
- Uncowed Forces
- Uncowed Forces
- Uncowed Forces
- Collection与Collections的区别
- Android编译系统详解(一)——build/envsetup.sh
- 十年一覺程設夢[完整版]
- const 指针与指向const的指针
- MPI和MapReduce对比
- 【codeforces】Uncowed Forces
- MongoDB从不懂到装懂其四(数据备份、恢复、导入、导出)
- <<More Effective C++>>读书笔记2: 运算符
- day2 HDU 2141 Can you find it?
- [李景山php]每天laravel-20160921|Redis Database.php
- 基于FPGA的Alpha半透明图像叠加算法实现
- 为什么析构函数常声明为虚函数?
- python 模拟登录csdn并获取博客列表等操作
- 快学scala 第十一章 操作符 读书笔记及习题答案代码