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 ...
随机推荐
- ORACLE TM锁
Oracle的TM锁类型 锁模式 锁描述 解释 SQL操作 0 none 1 NULL 空 Select 2 SS(Row-S) 行级共享锁,其他对象只能查询这些数据行 Select for upda ...
- netbeans中wicket插件对应的jQuery-ui版本
在netbean里使用wicket,我们经常习惯使用netbeans自带的wicket插件直接安装wicket,但是因为netbean上的 wicket插件版本比较老,使得我们很多新的第三方wicke ...
- 提问:"~"运算符
本人有一段代码关于"~"运算符 public class m{ public static void main(String[] args){ int x=~5; System.o ...
- Python 批量创建同文件名的特定后缀文件
看了很多批量创建文件和文件批量格式转换的code,感觉杀鸡焉用牛刀,自己写了几行轻量级的拿来给大家参考: 在out_dir目录下批量创建与in_dir目录下同文件名但后缀不同的文件. in_dir = ...
- [cocos2d-js]按钮整合成大图后打APK后不显示
网页版本都能正常显示碎图和整合成大图的 手机版本不正常 var btnKick = cc.MenuItemImage.create( "#btn_kick.png", " ...
- hdu5514-Frogs(容斥原理)好题
题意:有m个石头围成一圈,编号分别为0到m-1,现在有n只青蛙,都在0号石头上,第i只青蛙会从当前编号为p的石头跳到编号为(p+ai)%m的石头上.被青蛙经过的石头都会被占领,求这m块石头中所有被占领 ...
- 第三百二十七天 how can I 坚持
都没心情学习了,睡觉.太失败了. 好了,你赢了,最怕女人不说话了,我妈一生气就不说话,有点怕我妈,你想删就把我删了吧,我不怪你. 给你个善意的建议,任何事情都要有度,过犹而不及,你是属于那种比较听家 ...
- 全文索引之nutch与hadoop(转)
原文:http://blog.csdn.net/chaofanwei/article/details/39476535 全文索引-lucene,solr,nutch,hadoop之lucene 全文索 ...
- ubuntu设置服务开机启动
在Ubuntu下用sysv-rc-conf命令,它是chkconfig的替代命令,而使用方法与chkconfig基本相同. 安装: sudo apt-get install sysv-rc-conf ...
- tomcat 粗略笔记
GlobalNamingResources 存在于server.xml中,定义全局公共数据源,如果host中有大量引用相同的数据源,那么可以都配在这里 <GlobalNamingResource ...