博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[ACM_水题] ZOJ 3712 [Hard to Play 300 100 50 最大最小]
阅读量:6260 次
发布时间:2019-06-22

本文共 2988 字,大约阅读时间需要 9 分钟。

 

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:

 

P = Point * (Combo * 2 + 1)

 

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

 

题目大意:一共有三种数字300,100,50,每个样例中给出数字的个数,公式是P = Point * (Combo * 2 + 1),其中combo是这个数是第几个计算的。求P和的最大值和最小值。

解题思路:先算小的后算大的得出最大值,先算大的后算小的得出最小值

 

 

1 #include
2 using namespace std; 3 int main(){ 4 int T; 5 cin>>T; 6 while(T--){ 7 int A,B,C; 8 cin>>A>>B>>C; 9 int minSum=0,maxSum=0;10 int a=A,b=B,c=C;11 int cases=1;//正着算最大值12 while(c--){13 maxSum+=cases*50;14 cases+=2;15 }16 while(b--){17 maxSum+=cases*100;18 cases+=2;19 }20 while(a--){21 maxSum+=cases*300;22 cases+=2;23 }24 cases=1;//倒着算最小值25 while(A--){26 minSum+=cases*300;27 cases+=2;28 }29 while(B--){30 minSum+=cases*100;31 cases+=2;32 }33 while(C--){34 minSum+=cases*50;35 cases+=2;36 }37 cout<
<<' '<
<<'\n';38 }return 0;39 40 }
http://www.cnblogs.com/zjutlitao/p/3590351.html
你可能感兴趣的文章
Rust 1.30带来更多元编程支持,并改进了模块系统
查看>>
【转载】10个Web3D可视化精彩案例
查看>>
[deviceone开发]-动态添加组件add方法的示例
查看>>
极限编程创始人Ron Jeffries建议开发者放弃敏捷
查看>>
ticketea如何从一体化转向多体化架构
查看>>
解读2017之容器篇:后Kubernetes时代
查看>>
InfoQ播客:Randy Shoup谈Stitch Fix的技术栈,数据科学和微服务架构
查看>>
高德地图定位工具类
查看>>
Yelp开源数据管道项目最新组件——数据管道客户端库
查看>>
Docker周报:Windows Server将支持Mesos
查看>>
当编程语言掌握在企业手中,是生机还是危机?
查看>>
JetBrains Rider:一款全新的基于IntelliJ和ReSharper的.NET IDE
查看>>
Sonatype收购Vor Security,扩展对Nexus开源组件的支持
查看>>
Git 2.18版本已支持Git协议v2
查看>>
英孚教育全面上云与Serverless构建之路
查看>>
可执行镜像——开发环境的Docker化之路
查看>>
IntelliJ IDEA 2018.2支持Java 11、MacBook Touch Bar等新特性
查看>>
Microsoft 推出在AzureApp Service上支持Windows容器的公开预览版
查看>>
腾讯云携手朋迈推出“综合能源服务平台” 实现能源资源“智慧化”运营
查看>>
关于vue+webpack全局npm包全局引用的配置。
查看>>