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

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=0,f=1;char ch=getchar();
    while(ch<‘0‘||ch>‘9‘){if(ch==‘-‘)f=-1;ch=getchar();}
    while(ch>=‘0‘&&ch<=‘9‘){x=x*10+ch-‘0‘;ch=getchar();}
    return x*f;
}
//**************************************************************************************

double a[4],b[4],c[4];
int main()
{
    //test;
    int t=read();
    c[0]=1000,c[1]=1500,c[2]=2000,c[3]=2500;
    for(int cas=1;cas<=t;cas++)
    {
        for(int i=0;i<4;i++)
            cin>>a[i]>>b[i];
        int ans=0;
        for(int i=0;i<4;i++)
            ans+=max((250-a[i])/250*c[i]-b[i]*50,(c[i]*0.4));
        printf("Case #%d: %d\n",cas,ans);
    }

}
时间: 2024-12-13 05:10:30

hdu 5268 ZYB loves Score 水题的相关文章

HDU 5268 ZYB loves Score (BestCoder Round#44)

题目链接:ZYB loves Score 题面: ZYB loves Score Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 395    Accepted Submission(s): 232 Problem Description One day,ZYB participated in the BestCoder Contest

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

题意:计算Bestcoder四题的得分. 思路:直接模拟,4项分数直接计算后输出.注意不要低于百分之40的分. 1 //#include <bits/stdc++.h> 2 #include <iostream> 3 #include <cstdio> 4 #define LL long long 5 using namespace std; 6 const int N=10; 7 int a[N]; 8 int b[N]; 9 10 int cal() 11 { 12

HDU 5590 ZYB&#39;s Biology 水题

ZYB's Biology Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5590 Description ZYB(ZJ−267)在NOIP拿到600分之后开始虐生物题,他现在扔给你一道简单的生物题:给出一个DNA序列和一个RNA序列,问它们是否配对. DNA序列是仅由A,C,G,T组成的字符串,RNA序列是仅由A,C,G,U组成的字符串. DNA和RNA匹配当且仅当每

hdu 5272 Dylans loves numbers 水题

Dylans loves numbers Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5272 Description Dylans是谁?你可以在 UOJ 和 Codeforces上看到他.在BestCoder里,他有另外一个ID:s1451900.今天的题目都和他有关哦.Dylans得到了一个数N.他想知道N的二进制中有几组1.如果两个1之间有若干个(至少一个)0

hdu 1999 不可摸数 水题。

不可摸数 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7966    Accepted Submission(s): 2024 Problem Description s(n)是正整数n的真因子之和,即小于n且整除n的因子和.例如s(12)=1+2+3+4+6=16.如果任何数m,s(m)都不等于n,则称n为不可摸数. Input 包

HDU Senior&#39;s Gun (水题)

题意:给n把枪,m个怪兽,每把枪可消灭1怪兽,并获得能量=枪的攻击力-怪兽的防御力.求如何射杀能获得最多能量?(不必杀光) 思路:用最大攻击力的枪杀防御力最小的怪兽明显可获得最大能量.如果每把枪都去射杀刚好1点能量都拿不到的怪物,那简直等于把枪全丢掉. 1 //#pragma comment(linker,"/STACK:102400000,102400000") 2 #include <iostream> 3 #include <stdio.h> 4 #inc

UVa 1585 Score --- 水题

题目大意:给出一个由O和X组成的串(长度为1-80),统计得分. 每个O的分数为目前连续出现的O的个数,例如,OOXXOXXOOO的得分为1+2+0+0+1+0+0+1+2+3 解题思路:用一个变量term记录当前O的分数,若出现O,则term+1,若出现X,则term=0: 再用一个sum记录总和,没次加上term即可 /* UVa 1585 Score --- 水题 */ #include <cstdio> #include <cstring> const int maxn =

hdu 4847 Wow! Such Doge! 水题

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4847 统计文本中一共有多少个“Doge” 水题 #include <cstring> #include <cstdlib> #include <cstring> #include <cmath> #include <algorithm> #include <iostream> #include <cstdio> #includ

HDU 5578 Friendship of Frog 水题

Friendship of Frog Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5578 Description N frogs from different countries are standing in a line. Each country is represented by a lowercase letter. The distance betwee