hdu 5268 ZYB loves Score 水题
ZYB loves Score
Time Limit: 20 Sec
Memory Limit: 256 MB
题目连接
http://acm.hdu.edu.cn/showproblem.php?pid=5268
Description
There are four problems. Their scores are 1000,1500,2000,2500
According to the rules of BestCoder,If you solve one problem at x minutes,
You will get (250-x)/250∗100% of the original scores.
Obviously the final score must be an integer,becasue the original scores are multiple of 250
And if you make x wrong submissions,the score of this problem you get will be reduced by 50∗x
For example, if you solved the first problem in 5 minutes and you make one wrong submisson, the score of this problem is 980-50=930
To prevent very low scores,the lowest score of one problem is 40% of its original score
Input
For i-th line of each test case there are two integers A,B which means you solved the i-th problem in A minutes and you have made B wrong submissons.
0≤A≤105,0≤B≤100
Output
For each case, the output should occupies exactly one line. The output format is Case #x: ans, here x is the data number begins at 1.
Sample Input
2
4 0
12 0
20 0
103 0
17 1
29 0
57 0
84 0
Sample Output
Case #1: 5722
Case #2: 5412
HINT
题意
有一天ZYB参加了一场BestCoder,这场比赛一共有4道题,分数分别为1000,1500,2000,2500。
一道题目如果在第x分钟解决,那么你只能得到这道题原来分数的(250−x)/250∗100%
由于原分数都是250的倍数,所以分数肯定是整数
当一道题错误提交一次后,这道题的分数会额外降50分
比如1000分的题你在5分钟时解决,然后你错误提交了一次,分数就是980-50=930
为了防止分数过低,一道题的分数不会低于原来分数的40%
ZYB是个高手,他四道题在最后都通过了
给出他四道题的过题时间和错误提交次数,求他最后的得分
题解:
本题考察了选手的模拟能力,直接按照题目意思计算即可
代码:
#include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <sstream>
#include <queue>
#include <typeinfo>
#include <fstream>
#include <map>
#include <stack>
typedef long long ll;
using namespace std;
//freopen("D.in","r",stdin);
//freopen("D.out","w",stdout);
#define sspeed ios_base::sync_with_stdio(0);cin.tie(0)
#define test freopen("test.txt","r",stdin)
#define maxn 2000001
#define mod 10007
#define eps 1e-9
const int inf=0x3f3f3f3f;
const ll infll = 0x3f3f3f3f3f3f3f3fLL;
inline ll read()
{
ll x=,f=;char ch=getchar();
while(ch<''||ch>''){if(ch=='-')f=-;ch=getchar();}
while(ch>=''&&ch<=''){x=x*+ch-'';ch=getchar();}
return x*f;
}
//************************************************************************************** double a[],b[],c[];
int main()
{
//test;
int t=read();
c[]=,c[]=,c[]=,c[]=;
for(int cas=;cas<=t;cas++)
{
for(int i=;i<;i++)
cin>>a[i]>>b[i];
int ans=;
for(int i=;i<;i++)
ans+=max((-a[i])/*c[i]-b[i]*,(c[i]*0.4));
printf("Case #%d: %d\n",cas,ans);
} }
hdu 5268 ZYB loves Score 水题的更多相关文章
- HDU 5268 ZYB loves Score (简单模拟,水)
题意:计算Bestcoder四题的得分. 思路:直接模拟,4项分数直接计算后输出.注意不要低于百分之40的分. //#include <bits/stdc++.h> #include &l ...
- HDU 5590 ZYB's Biology 水题
ZYB's Biology Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid ...
- hdu 5272 Dylans loves numbers 水题
Dylans loves numbers Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem. ...
- HDU 5655 CA Loves Stick 水题
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5656 CA Loves Stick Accepts: 381 Submissions: 3204 ...
- HDU 5645 DZY Loves Balls 水题
DZY Loves Balls 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5645 Description DZY loves playing b ...
- UVa 1585 Score --- 水题
题目大意:给出一个由O和X组成的串(长度为1-80),统计得分. 每个O的分数为目前连续出现的O的个数,例如,OOXXOXXOOO的得分为1+2+0+0+1+0+0+1+2+3 解题思路:用一个变量t ...
- HDU 5538 L - House Building 水题
L - House Building Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.ph ...
- HDU 5578 Friendship of Frog 水题
Friendship of Frog Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.ph ...
- hdu 1005:Number Sequence(水题)
Number Sequence Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)T ...
随机推荐
- SignalR 循序渐进
SignalR 循序渐进(五)多个Hub服务器下的消息订阅 hellsoul86 2014-08-18 11:29 阅读:840 评论:7 SignalR 循序渐进(四) Hub的生命周期以及 ...
- AngularJS自定义指令(Directives)在IE8下的一个坑
在项目中,由于要兼容到IE8,我使用1.2.8版本的angularJS.这个版本是支持自定义指令的.我打算使用自定义指令将顶部的header从其他页面分离.也就是实现在需要header的页面只用在&l ...
- md5加密算法c语言版
from: http://blog.sina.com.cn/s/blog_693de6100101kcu6.html 注:以下是md5加密算法c语言版(16/32位) ---------------- ...
- 配置spring管理的bean的作用域
.singleton 在每一个spring Ioc容器中一个bean定义只有一个对象实例.默认情况下会在容器启动时初始化bean,但我们可以指定bean节点的lazy-init = "tru ...
- 判断浏览器是IE的几种方式
<script> if(!+[1,])alert("这是ie浏览器"); else alert("这不是ie浏览器"); </script&g ...
- 利用 Oracle EM 企业管理器 进行oracle SQL的优化(自动生成索引)
利用 Oracle EM 企业管理器 进行oracle SQL的优化(自动生成索引) ##应用情景 项目中有大量的SQL,尤其是涉及到统计报表时,表关联比较多,当初开发建表时也没搞好索引关联的,上线后 ...
- 通过ajax提交form表单
$.ajax({ url : 'deliveryWarrant/update.do', data : $('#myform').serialize(), type : "POST" ...
- js运动 分享到
<!doctype html> <html> <head> <meta charset = "utf-8"> <title&g ...
- Ubuntu下gdb远程调试--warning: Could not load vsyscall page because no executable was specified解决方案
1. 首先安装gdbserver apt-get install gdbserver 2. 编译-g 程序 gcc -g test_gdb.c -o test_gdb 源码如下: #include & ...
- 使用logmnr方法找回被误删除Oracle的数据的脚本
俗话说,常在河边走,哪有不湿鞋的.作为一个经常与数据库打交道的程序员,偶尔不小心误删除或误操作的数据也是在所难免的.如果是Oracle数据库,这里给您介绍一种从日志中找回数据的办法,下面这个地址是我以 ...