【 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. ...
随机推荐
- POJ 2449 Remmarguts' Date --K短路
题意就是要求第K短的路的长度(S->T). 对于K短路,朴素想法是bfs,使用优先队列从源点s进行bfs,当第K次遍历到T的时候,就是K短路的长度. 但是这种方法效率太低,会扩展出很多状态,所以 ...
- POJ 2823 Sliding Window 再探单调队列
重新刷这个经典题,感觉跟以前不一样了,变得更加容易理解了,不讲解了,看代码.注意:要用C++提交,用G++会超时.. 代码: #include <iostream> #include &l ...
- UESTC 1227 & POJ 3667 Hotel
非常细腻的线段树题目啊,后来还是有个细节写错了,查了一个晚上..就不分析了. 代码: #include <iostream> #include <cstdio> #includ ...
- Android service ( 一 ) 三种开启服务方法
一. Service简介 Service是android 系统中的四大组件之一(Activity.Service.BroadcastReceiver.ContentProvider),它跟 Activ ...
- C和指针 3.9作用域、存储类型示例
; extern int b; static int c; int d( int e ) { ; register int b; ; extern int a; ... { int e; int a; ...
- 工厂模式(Factory Patter)
1.工厂模式简介 工厂模式属于创建型模式,是专门用来创建对象的模式,抽象了实例化的过程.工厂模式分为 : 工厂方法模式.抽象工厂模式. 在学习工厂方法模式.抽象工厂之前,首先先要了解一下简单工厂模式, ...
- 大话Git
Git是什么 Git是一个分布式版本控制系统.它可以很方便的记录你的每一次变动,而不需要每次都备份,还能让你和他人很方便的协同开发.这样你每次做了什么改动,瞄一眼就一清二楚了. -- 安装Git 从官 ...
- alert,confirm和prompt
1.警告消息框alertalert 方法有一个参数,即希望对用户显示的文本字符串.该字符串不是 HTML 格式.该消息框提供了一个“确定”按钮让用户关闭该消息框,并且该消息框是模式对话框,也就是说,用 ...
- 十一、常用的NSArray和NSMutableArray方法
1.概念 用来存储OBJ对象的有序列表,它是不可变的 2.创建常用方法 + (id)array + (id)arrayWithObect:(id)anObject + (id)arrayWithObe ...
- 数字签名的定义及在K2 BPM业务流程管理中的应用
背景介绍 ARX(算法研究)公司是一家数字签名和数据安全解决方案的领先供应商.该公司专门从事结合软件和硬件产品为大中小型计算机环境设计和实现数字签名解决方案. 很多流程都需要和数字签名进行集成,用于审 ...