【 CodeForces 604A】B - 特别水的题2-Uncowed Forces
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 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 100
0 1 2 3 4
1 0
4900
119 119 119 119 119
0 0 0 0 0
10 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 = 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的更多相关文章
- 【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 ...
- 【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 ...
- 【CodeForces 606A】A -特别水的题1-Magic Spheres
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=102271#problem/A Description Carl is a beginne ...
- 【CodeForces 602A】C - 特别水的题3-Two Bases
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=102271#problem/C Description After seeing the ...
- 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 ...
- Codeforces Round #378 (Div. 2) D题(data structure)解题报告
题目地址 先简单的总结一下这次CF,前两道题非常的水,可是第一题又是因为自己想的不够周到而被Hack了一次(或许也应该感谢这个hack我的人,使我没有最后在赛后测试中WA).做到C题时看到题目情况非常 ...
- CodeForces.158A Next Round (水模拟)
CodeForces.158A Next Round (水模拟) 题意分析 校赛水题的英文版,坑点就是要求为正数. 代码总览 #include <iostream> #include &l ...
- Codeforces Round #612 (Div. 2) 前四题题解
这场比赛的出题人挺有意思,全部magic成了青色. 还有题目中的图片特别有趣. 晚上没打,开virtual contest打的,就会前三道,我太菜了. 最后看着题解补了第四道. 比赛传送门 A. An ...
- Codeforces 828B Black Square(简单题)
Codeforces 828B Black Square(简单题) Description Polycarp has a checkered sheet of paper of size n × m. ...
随机推荐
- Golang tool:include spider library,image library and some other db library such as mysql,redis,mogodb,hbase,cassandra
一.Go_tool This is a tool library for Golang.Dont't worry about not understant it! All comment writes ...
- UVALive 6093 Emergency Room --优先队列实现的模拟
题意:给n个医生,这些医生有一个上班时间,然后给一些病人,病人有一个到达的时间,以及一些诊断,诊断有property(优先级)和duration(诊断时间)这两个属性,每个病人可能要诊断多次,最后问每 ...
- UESTC 32 树上战争(Battle on the tree)
这题其实很简单,每个人肯定都往上走,才能保证尽快赢,所以无非是看谁离根节点近,即深度小..用并查集中的findset思想,不断找父节点一直到根节点来找深度就可以了. 代码: #include < ...
- bootstrap学习总结-css组件(三)
今天我们来看看css组件效果以及其中比较重要的类,这些类都不难,关键要熟练掌握,搭配使用,灵活运用.关于前两篇中,css样式和布局的文章,大家可以在首页进行阅读.http://www.cnblogs. ...
- [汇编] 002基础知识-CPU和寄存器
CPU是什么 当然这里的内存不仅仅指电脑上的内存,例如:我的金士顿8G内存,七彩虹1G独显,在这里来说,显卡也是有内存的(寄存器) CPU如何控制其它部件的? 问题:CPU是如何和电脑主机中其它芯片有 ...
- [3D跑酷] GameManager
GameManager在游戏中很重要,处理整个游戏的流程,但是在这个类中尽量也只是写一些重要的方法,调用其它类中的方法. 枚举项 函数列表 方法解释 //当玩家碰到障碍(障碍Type,碰撞Positi ...
- unity3d Aniso Level 摄像机近地面清楚,远地面模糊
设置方法 选中贴图 在属性面板,拖动Aniso Level的值从0~9改变,值越大贴图越清晰,但是消耗也变大,文档说会造成显卡消耗,一般只用在地面上,其他地方没必要 遇到的问题 但是打包到Ipod上面 ...
- 反序列化存入数据库里面的session数据
session数据存取的方法可通过session.serialize_handler方法来判断,反序列化可通过下面的unserialize方法,参考http://stackoverflow.com/q ...
- 解决Linux中java.net.UnknownHostException: oracledb.sys.iflashbuy.com问题
Linux环境报java.net.UnknownHostException: oracledb.sys.iflashbuy.com,原因为Linux下无法解析oracledb.sys.iflashbu ...
- android strings.xml 报 is not translated in af,
57 down vote In your ADT go to window->Preferences->Android->Lint Error Checking Find there ...