zoj 3712 Hard to Play(数学题)
来源:互联网 发布:abb机器人编程指令实例 编辑:程序博客网 时间:2024/05/17 22:26
转载请注明出处:http://blog.csdn.net/u012860063?viewmode=contents
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3712
题意:
分别输出得分最大值和最小值!Combo开始为0,随后一直加1,知道结束!因为MightyHorse从不失手!
MightyHorse is playing a music game called osu!.
After playing for several months, MightyHorse discovered the way of calculating score in osu!:
1. While playing osu!, player need to click some circles following the rhythm. Each time a player clicks, it will have three different points: 300, 100 and 50, deciding by how clicking timing fits the music.
2. Calculating the score is quite simple. Each time player clicks and gets P points, the total score will add P, which should be calculated according to following formula:
Here Point is the point the player gets (300, 100 or 50) and Combo is the number of consecutive circles the player gets points previously - That means if the player doesn't miss any circle and clicks the ith circle, Combo should be i - 1.
Recently MightyHorse meets a high-end osu! player. After watching his replay, MightyHorse finds that the game is very hard to play. But he is more interested in another problem: What's the maximum and minimum total score a player can get if he only knows the number of 300, 100 and 50 points the player gets in one play?
As the high-end player plays so well, we can assume that he won't miss any circle while playing osu!; Thus he can get at least 50 point for a circle.
Input
There are multiple test cases.
The first line of input is an integer T (1 ≤ T ≤ 100), indicating the number of test cases.
For each test case, there is only one line contains three integers: A (0 ≤ A ≤ 500) - the number of 300 point he gets, B (0 ≤ B ≤ 500) - the number of 100 point he gets and C (0 ≤ C ≤ 500) - the number of 50 point he gets.
Output
For each test case, output a line contains two integers, describing the minimum and maximum total score the player can get.
Sample Input
12 1 1
Sample Output
2050 3950
Author: DAI, Longao
Contest: The 10th Zhejiang Provincial Collegiate Programming Contest
代码如下:
#include<cstdio>#include<iostream>#include<algorithm>#include<cstring>#include<cmath>using namespace std;int main(){int i,j,m,n,t,sum,s,max,x,min;int a,b,c;while(scanf("%d",&t)!=EOF){while(t--){min = max = 0;scanf("%d%d%d",&a,&b,&c);s = a+b+c;for(j = 0 ;j < a ; j++ )min += 300 *(2 * j + 1);for(j = a ; j<a+b ;j++){min+=100*(2*j+1);}for(j = a+b; j < s ; j++ ){min+=50*(2 * j + 1);}for(j = 0 ;j < c ; j++ )max += 50 *(2 * j + 1);for(j = c ; j < c+b ;j++){max+=100*(2*j+1);}for(j = b+c; j < s ; j++ ){max+=300*(2 * j + 1);}printf("%d %d\n",min,max);}}return 0;}
- zoj 3712 Hard to Play(数学题)
- ZOJ 3712Hard to Play(水题)
- zoj 3712 Hard to Play
- ZOJ 3712 Hard to Play
- ZOJ 3712 Hard to Play
- ZOJ 3712 Hard to Play
- ZOJ 3712 Hard to Play
- ZOJ 3712 Hard to Play
- ZOJ 3712 Hard to Play
- zoj 3712 Hard to Play
- ZOJ-3712-Hard to Play
- Hard to Play ZOJ 3712
- ZOJ-Hard to Play
- ZOJ 3712 Hard to Play(贪心题)
- ZOJ 3712Hard to Play(模拟)
- ZOJ-3712-Hard to Play【10th浙江省赛】
- zju 3712 Hard to Play
- ZOJ3712:Hard to Play
- 在BBB启动时自动加载dtbo(或执行脚本、运行程序)
- JAVA--100内的素数
- tomcat下域名的配置,ROOT.xml的作用
- HTML5表单验证特性
- 数字信号处理基本概念
- zoj 3712 Hard to Play(数学题)
- 浙大2012上机 PAT 1032. Sharing (25)
- 收藏一些规范化输入输出的PHP函数
- UDP下的网络穿越代码实现
- javaSE学习日志之-----建一个类似记事本的小程序
- csdn不能打开
- 黑马程序员日记01
- PHP:ignore_user_abort()+set_time_limit(0)+sleep($interval)实现计划任务
- POJ 3104 Drying (二分&最大化最小值)