Codeforces Round #334 (Div. 2) A. Uncowed Forces (水题)
来源:互联网 发布:jing 软件 编辑:程序博客网 时间:2024/05/20 12:51
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 minutem but 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.
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.
Print a single integer, the value of Kevin's final score.
20 40 60 80 1000 1 2 3 41 0
4900
119 119 119 119 1190 0 0 0 010 0
4930
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 in10·100 = 1000 points from hacks, his total score becomes 3930 + 1000 = 4930.
注意数据类型
防止精度丢失
#include <bits/stdc++.h>using namespace std;int v[6]={500,1000,1500,2000,2500,0};int m[6],w[6];int s,u;int main(){ std::ios::sync_with_stdio(false); std::cin.tie(0); for(int i=0; i<5; i++){ cin>>m[i]; } for(int i=0; i<5; i++){ cin>>w[i]; } cin>>s>>u; double ans=0; for(int i=0; i<5; i++){ ans+=max(0.3*v[i], (1-m[i]/250.0)*v[i]-50.0*w[i]); } ans+=100*s; ans-=50*u; cout<<ans<<endl; return 0;}
- Codeforces Round #334 (Div. 2) A. Uncowed Forces (水题)
- Codeforces Round #334 (Div. 2) A. Uncowed Forces
- Codeforces Round #334 (Div. 2) A. Uncowed Forces
- Codeforces Round #334 (Div. 2) A. Uncowed Forces
- 【Codeforces Round 334 (Div 2)A】【模拟 水题】Uncowed Forces CF算分模拟
- Codeforces Round #334 (Div. 2)A. Uncowed Forces(简单计算)
- Uncowed Forces Codeforces Round #334
- 【CodeForces】604A - Uncowed Forces(水)
- 【codeforces】-604A-Uncowed Forces(水)
- CodeForces 604 A.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】Uncowed Forces
- 建议41:实现标准的事件模型
- CorelDRAW X6 零基础教学入门
- C# 短信猫(SMS cat) 操作源码开发经验
- This function or variable may be unsafe. VS
- git远程操作常用命令
- Codeforces Round #334 (Div. 2) A. Uncowed Forces (水题)
- AsyncTask 异步任务
- Python基础02 基本数据类型
- boost::condition_variable、boost::time_wait使用方法
- 关于索引的B tree B-tree B+tree B*tree 详解结构图
- SPI、IIC、UART区别
- 高性能流媒体服务器-nebula之数据结构(6)--无节点内存分配的单、双链表
- 哎,学一半发现难以绕过著名数据分析模块
- java自增策略小陷阱