HDU 5268 ZYB loves Score——BestCoder Round #44(模拟)
来源:互联网 发布:阿里云 虚拟主机 美国 编辑:程序博客网 时间:2024/06/08 13:52
ZYB loves Score
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
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 atx 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 makex 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 is40% of its original score
There are four problems. Their scores are 1000,1500,2000,2500
According to the rules of BestCoder,If you solve one problem at
You will get (250-x)/250
Obviously the final score must be an integer,becasue the original scores are multiple of 250
And if you make
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
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 integersA ,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
For i-th line of each test case there are two integers
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
24 012 020 0103 017 129 057 084 0
Sample Output
Case #1: 5722Case #2: 5412
Source
BestCoder Round #44
附上该题对应的中文题
ZYB loves Score
Time Limit: 2000/1000 MS (Java/Others)
Memory Limit: 65536/65536 K (Java/Others)
问题描述
有一天ZYB参加了一场BestCoder,这场比赛一共有4道题,分数分别为1000,1500,2000,2500。一道题目如果在第x分钟解决,那么你只能得到这道题原来分数的(250−x)/250∗100%由于原分数都是250的倍数,所以分数肯定是整数当一道题错误提交一次后,这道题的分数会额外降50分比如1000分的题你在5分钟时解决,然后你错误提交了一次,分数就是980-50=930为了防止分数过低,一道题的分数不会低于原来分数的40%ZYB是个高手,他四道题在最后都通过了给出他四道题的过题时间和错误提交次数,求他最后的得分
输入描述
一共T(T≤20)组数据,对于每组数据:一共四行,每行一个非负整数A,B,表示这一题在A分钟获得Accept,错误提交了B次第x行表示第x题0≤A≤105,0≤B≤100
输出描述
每组数据输出一行Case #x: ans。x表示组数编号,从1开始。ans为所求值。
输入样例
24 012 020 0103 017 129 057 084 0
输出样例
Case #1: 5722Case #2: 5412
/****************************************************/
出题人的解题思路:
本题考察了选手的模拟能力,直接按照题目意思计算即可4道题满分分别为1000、1500、2000、2500,假设该题满分为k分,那么若你做出该题的时间为t,错误的次数为c,则最终该题得分为
按照该公式分别算出4道题的得分,再求和即可
#include<stdio.h>#include<string.h>#include<stdlib.h>#include<queue>#include<math.h>#include<vector>#include<map>#include<set>#include<cmath>#include<string>#include<algorithm>#include<iostream>#define exp 1e-10using namespace std;const int N = 50;const int inf = 1000000000;int fun(int t,int k,int c){ int n=2*c/5; c=c/250*(250-t)-k*50; return c>n?c:n;}int main(){ int t,i,ans,a,b,j=1; scanf("%d",&t); while(t--) { ans=0; for(i=0;i<4;i++) { scanf("%d%d",&a,&b); ans+=fun(a,b,1000+i*500); } printf("Case #%d: %d\n",j++,ans); } return 0;}菜鸟成长记
0 0
- HDU 5268 ZYB loves Score——BestCoder Round #44(模拟)
- HDU 5268 ZYB loves Score (BestCoder Round#44)
- HDU 5269 ZYB loves Xor I——BestCoder Round #44(字典树)
- hdu 5269 ZYB loves Xor I && BestCoder Round #44
- 模拟 hdu5268 ZYB loves Score
- HDU 5269 && BestCoder #44 1002 ZYB loves Xor I (分治)
- HDU 5272 Dylans loves numbers——BestCoder Round #45(模拟)
- BestCoder#44 ZYB loves Xor I
- HDU 5273 Dylans loves sequence——BestCoder Round #45(DP or 树状数组)
- HDU 5675 ztr loves math——BestCoder Round #82(div.2)
- HDU 5806 NanoApe Loves Sequence Ⅱ(尺取+思维)——BestCoder Round #86 1003
- BestCoder Round #86 1002 &HDU 5805 ——NanoApe Loves Sequence
- BestCoder Round #86 1003 &HDU 5806——NanoApe Loves Sequence Ⅱ
- HDU 5996 dingyeye loves stone(阶梯尼姆博弈)——BestCoder Round #90
- HDU 6021 MG loves string(容斥原理)——BestCoder Round #93 1003
- HDU 5805 BestCoder Round #86 NanoApe Loves Sequence (水题—求期望)
- HDU 5676 ztr loves lucky numbers(dfs+离线)——BestCoder Round #82(div.1 div.2)
- BestCoder Round #76 (div.2)-DZY Loves Partition(模拟)
- poj 1679 The Unique MST 【次小生成树模版】
- 数据结构(14)单链表
- HTML笔记
- poj-1611 The Suspects
- C语言-Branch
- HDU 5268 ZYB loves Score——BestCoder Round #44(模拟)
- JDBC应用小案例
- 算法1:k-近邻
- 如何配置android sdk manager进行强制下载
- 数据库
- CSU 1511 残缺的棋盘
- 基于 Android NDK 的学习之旅-----HelloWorld
- 535 Error: authentication failed
- poj2362 Square