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

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

Source

BestCoder Round #44

解题:套下公式即可,注意分数不能低于40%。

代码:

#include <iostream>
#include <cmath>
#define e  2.718281828459
using namespace std;
int max(double a,int b)
{
	if(a>b)return (int)a;
	else return b;
}
int main()
{
	int t,total,timee,wrong;
	cin>>t;
	for(int i=1;i<=t;i++)
	{
		total=0;
		for(int j=1000;j<=2500;j+=500)
		{
			cin>>timee>>wrong;
			total+=max((250.0-timee)/250*j-wrong*50,j*2/5);
		}
		cout<<"Case #"<<i<<": "<<total<<endl;
	}
   return 0;
}

版权声明:本文为博主原创文章,未经博主允许不得转载。

时间: 2024-10-10 07:02:46

HDU 5268 ZYB loves Score (BestCoder Round#44)的相关文章

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 r

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 5230 ZCC loves hacking(BestCoder Round #41)

ZCC loves hacking                                                   Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 262144/131072 K (Java/Others) Total Submission(s): 126    Accepted Submission(s): 49 Problem Description Now, a Codefires roun

HDU 5995 Kblack loves flag ---BestCoder Round #90

题目链接 用两个布尔数组分别维护每个行/列是否被插过旗帜,最后枚举每一行.列统计答案即可.空间复杂度O(n+m),时间复杂度O(n+m+k). #include <cstdio> #include <iostream> #include <cstring> using namespace std; int t,ansx[1000005],ansy[1000005],ax,ay; const int _K=50268147,_B=6082187,_P=100000007;

HDU 5996 dingyeye loves stone ---BestCoder Round #90

题目链接 设根节点的深度为0,将所有深度为奇数的节点的石子数目xor起来,则先手必胜当且仅当这个xor和不为0. 证明同阶梯博弈.对于偶深度的点上的石子,若对手移动它们,则可模仿操作:对于奇深度上的石子,移动一次即进入偶深度的点. 时空复杂度O(n). 用vector存搜一下就行. #include <cstdio> #include <iostream> #include <vector> #include <cstring> using namespac

HDU-5194-DZY Loves Balls(BestCoder Round # 35 )

DZY Loves Balls Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 374    Accepted Submission(s): 205 Problem Description There are n black balls and m white balls in the big box. Now, DZY starts

HDU 5224 Tom and paper(BestCoder Round #40)

题目链接:Tom and paper 题面: Tom and paper Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 679    Accepted Submission(s): 432 Problem Description There is a piece of paper in front of Tom, its length

ACM学习历程—HDU5269 ZYB loves Xor I(位运算 &amp;&amp; dfs &amp;&amp; 排序)(BestCoder Round #44 1002题)

Problem Description Memphis loves xor very musch.Now he gets an array A.The length of A is n.Now he wants to know the sum of all (lowbit(Ai xor Aj) (i,j∈[1,n]) We define that lowbit(x)=2^k,k is the smallest integer satisfied ((x and 2^k)>0)Specially,

bestcoder r44 p3 hdu 5270 ZYB loves Xor II

这是昨晚队友跟我说的题,不知道当时是什么玄幻的事件发生了,,我看成了两两相乘的XOR 纠结了好长时间间 不知道该怎么办 今天早上看了下这道题,发现是两两相加的XOR  然后就想了想昨晚的思路 发现可做 对于 XOR 在我的记忆中 ,大部分的都是拆成数位来做 那么这题  .... 其实也是类似的 拆成数位.有两种拆法  将数据拆成数位和将答案拆成数位(其实就是考虑答案的每一位) 想了想将数据拆成数位·········· 没法单独考虑每一位的‘功’ 那就将考虑答案的每一位了 最好考虑的是第一位了 只