ZYB loves Score

Time Limit: 20 Sec

Memory Limit: 256 MB

题目连接

http://acm.hdu.edu.cn/showproblem.php?pid=5268

Description

One day,ZYB participated in the BestCoder Contest

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

Multiple test cases, the first line contains an integer T(no more than 20), indicating the number of cases. Each test case contains four lines

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 水题的更多相关文章

  1. HDU 5268 ZYB loves Score (简单模拟,水)

    题意:计算Bestcoder四题的得分. 思路:直接模拟,4项分数直接计算后输出.注意不要低于百分之40的分. //#include <bits/stdc++.h> #include &l ...

  2. HDU 5590 ZYB's Biology 水题

    ZYB's Biology Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid ...

  3. hdu 5272 Dylans loves numbers 水题

    Dylans loves numbers Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem. ...

  4. HDU 5655 CA Loves Stick 水题

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5656 CA Loves Stick Accepts: 381   Submissions: 3204 ...

  5. HDU 5645 DZY Loves Balls 水题

    DZY Loves Balls 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5645 Description DZY loves playing b ...

  6. UVa 1585 Score --- 水题

    题目大意:给出一个由O和X组成的串(长度为1-80),统计得分. 每个O的分数为目前连续出现的O的个数,例如,OOXXOXXOOO的得分为1+2+0+0+1+0+0+1+2+3 解题思路:用一个变量t ...

  7. HDU 5538 L - House Building 水题

    L - House Building Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.ph ...

  8. HDU 5578 Friendship of Frog 水题

    Friendship of Frog Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.ph ...

  9. hdu 1005:Number Sequence(水题)

    Number Sequence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)T ...

随机推荐

  1. go 应用程序性能测试

    runtime/pprof 我们要加入对pprof包里的方法调用,程序才能将运行时候程序的堆内存分配状态记录到文件(也可以是写到其他地方,例如网络等)中,以便进一步的分析. 如果你的go程序只是一个应 ...

  2. (转)Visual Studio原生开发的10个调试技巧(二)

    我以前关于Visual Studio调试技巧的文章引起了大家很大的兴趣,以至于我决定分享更多调试的知识.以下的列表中你可以看到写原生开发的调试技巧(接着以前的文章来编号).这些技巧可以应用在VS200 ...

  3. hdu5248 序列变换

    百度之星的题.其实最简单的方法是二分答案,我竟然没想到,直接去想O(n)的去了,最后导致滚粗... 题意就是给一个数列,要求把它处理成递增序列. 首先我想到了O(n^2)的算法,然后再优化成O(n)过 ...

  4. HTML5_画布_太阳系

    HTML5_画布_太阳系 一.canvas属性和方法的简单介绍①对于不支持canvas标签的浏览器需要显示"不支持canvas"使用IE11浏览器的开发人员工具,仿真:文档模式=8 ...

  5. DouNet学习_Excel导入导出

    Excel --->列是有限的 -->数据靠在单元格右边是数字类型,左边是字符串类型 把一个数字当初字符串来显示 在前面加个 ' -->用程序操作Excel 可以使用Excel的所有 ...

  6. 三角剖分求多边形面积的交 HDU3060

    //三角剖分求多边形面积的交 HDU3060 #include <iostream> #include <cstdio> #include <cstring> #i ...

  7. 【C traps and pit falls】阅读笔记

    已经是第几遍读C 陷阱与缺陷了,某种意义上,这不是一本常读常新的书,大概是因为读一遍过后就记住了. 一.编译器在将程序分解成符号的时候,使用的是大嘴法. 二.使用不对称边界有很多好处. 三.缓冲输出与 ...

  8. [POJ] #1008# Maya Calendar : 字符处理/同余问题

    一. 题目 Maya Calendar Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 74085   Accepted: 2 ...

  9. Orion Network Performance Monitor 软件在网络管理中的应用

    Orion Network Performance Monitor 软件在网络管理中的应用       Orion Network Performance Monitor是完全的带宽性能和故障管理软件 ...

  10. 第三百二十九天 how can I 坚持

    今天莫名其妙的烦,,都是上午搞电脑搞的,好乱,心情很差,又感觉有那么多事. 希望周六不要加班啊.很烦,不想加班. 貌似事情也不是很多.但是为什么会感觉乱七八糟的呢,力不从心的感觉,是能力不行吗. 晚上 ...