CodeForces 604A Uncowed Forces
2016-07-21 18:18
169 查看
D - Uncowed Forces
Time Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d
& %I64u
Submit Status
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
![](http://7xjob4.com1.z0.glb.clouddn.com/b88a5360874bb4032b30bed30e3c95fa)
.
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
Input
Output
Input
Output
Hint
In the second sample, Kevin takes 119 minutes on all of the problems. Therefore, he gets
![](http://7xjob4.com1.z0.glb.clouddn.com/d7f90c744c3f7d091ff48c94dc1a45af)
of
the points on each problem. So his score from solving problems is
![](http://7xjob4.com1.z0.glb.clouddn.com/740d64780053d1e0431f5c4af134dd91)
. Adding in 10·100 = 1000 points
from hacks, his total score becomes 3930 + 1000 = 4930.
根据公式计算一遍即可。
#include<stdio.h>
#include<algorithm>
using namespace std;
int main()
{
int m1,m2,m3,m4,m5,w1,w2,w3,w4,w5,h1,h2;
while(scanf("%d%d%d%d%d",&m1,&m2,&m3,&m4,&m5)!=EOF)
{
double sum=0.0;
scanf("%d%d%d%d%d",&w1,&w2,&w3,&w4,&w5);
scanf("%d%d",&h1,&h2);
sum+=max(0.3*500,(1.0-(m1*1.0)/250.0)*500.0-50.0*w1);
sum+=max(0.3*1000,(1.0-(m2*1.0)/250.0)*1000.0-50.0*w2);
sum+=max(0.3*1500,(1.0-(m3*1.0)/250.0)*1500.0-50.0*w3);
sum+=max(0.3*2000,(1.0-(m4*1.0)/250.0)*2000.0-50.0*w4);
sum+=max(0.3*2500,(1.0-(m5*1.0)/250.0)*2500.0-50.0*w5);
sum+=h1*100.0-h2*50.0;
printf("%.lf\n",sum);
}
}
Time Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d
& %I64u
Submit Status
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
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 = 1000 points
from hacks, his total score becomes 3930 + 1000 = 4930.
根据公式计算一遍即可。
#include<stdio.h>
#include<algorithm>
using namespace std;
int main()
{
int m1,m2,m3,m4,m5,w1,w2,w3,w4,w5,h1,h2;
while(scanf("%d%d%d%d%d",&m1,&m2,&m3,&m4,&m5)!=EOF)
{
double sum=0.0;
scanf("%d%d%d%d%d",&w1,&w2,&w3,&w4,&w5);
scanf("%d%d",&h1,&h2);
sum+=max(0.3*500,(1.0-(m1*1.0)/250.0)*500.0-50.0*w1);
sum+=max(0.3*1000,(1.0-(m2*1.0)/250.0)*1000.0-50.0*w2);
sum+=max(0.3*1500,(1.0-(m3*1.0)/250.0)*1500.0-50.0*w3);
sum+=max(0.3*2000,(1.0-(m4*1.0)/250.0)*2000.0-50.0*w4);
sum+=max(0.3*2500,(1.0-(m5*1.0)/250.0)*2500.0-50.0*w5);
sum+=h1*100.0-h2*50.0;
printf("%.lf\n",sum);
}
}
相关文章推荐
- Leetcode 342. Power of Four (Easy) (cpp)
- Postfix的使用与分析
- NYOJ 973 SPFA判环
- svn使用经验
- 爬虫例子——多页、函数模板
- iOS - is missing from working copy
- Java微信浏览器上传文件使用Base64方法(增加压缩上传方法)
- c# web 常见问题解决方法
- 回调机制
- UCloud 活动
- debug安卓屏幕滑动会抖动
- 数据库sql 查询列属性 增加列 修改列长度 建表 自增
- 三步实现mybatis自定义的typehandler
- 进入ubuntu终端
- clauch svn使用设置
- CodeForces 612A The Text Splitting
- 解决font-face跨域办法
- 飞凌Fl2440开发板蜂鸣器pwm的驱动
- android byte字节数组转换十六进制字符串
- 线程池的理解