[ACM_水题] ZOJ 3712 [Hard to Play 300 100 50 最大最小]
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
1
2 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和的最大值和最小值。
解题思路:先算小的后算大的得出最大值,先算大的后算小的得出最小值
#include<iostream>
using namespace std;
int main(){
int T;
cin>>T;
while(T--){
int A,B,C;
cin>>A>>B>>C;
int minSum=,maxSum=;
int a=A,b=B,c=C;
int cases=;//正着算最大值
while(c--){
maxSum+=cases*;
cases+=;
}
while(b--){
maxSum+=cases*;
cases+=;
}
while(a--){
maxSum+=cases*;
cases+=;
}
cases=;//倒着算最小值
while(A--){
minSum+=cases*;
cases+=;
}
while(B--){
minSum+=cases*;
cases+=;
}
while(C--){
minSum+=cases*;
cases+=;
}
cout<<minSum<<' '<<maxSum<<'\n';
}return ; }
[ACM_水题] ZOJ 3712 [Hard to Play 300 100 50 最大最小]的更多相关文章
- [ACM_水题] ZOJ 3706 [Break Standard Weight 砝码拆分,可称质量种类,暴力]
The balance was the first mass measuring instrument invented. In its traditional form, it consists o ...
- [ACM_水题] ZOJ 3714 [Java Beans 环中连续m个数最大值]
There are N little kids sitting in a circle, each of them are carrying some java beans in their hand ...
- ACM_水题你要信了(修改版)
水题你要信了 Time Limit: 2000/1000ms (Java/Others) Problem Description: 某发最近又认识了很多妹(han)子,可是妹(han)子一多不免有时会 ...
- 水题 ZOJ 3875 Lunch Time
题目传送门 /* 水题:找排序找中间的价格,若有两个,选价格大的: 写的是有点搓:) */ #include <cstdio> #include <iostream> #inc ...
- 水题 ZOJ 3876 May Day Holiday
题目传送门 /* 水题:已知1928年1月1日是星期日,若是闰年加1,总天数对7取余判断就好了: */ #include <cstdio> #include <iostream> ...
- 水题 ZOJ 3880 Demacia of the Ancients
题目传送门 /* 水题:) */ #include <cstdio> #include <iostream> #include <algorithm> #inclu ...
- 水题 ZOJ 3869 Ace of Aces
题目传送门 水题,找出出现次数最多的数字,若多个输出Nobody //#include <bits/stdc++.h> //using namespace std; #include &l ...
- [ACM_水题] UVA 12502 Three Families [2人干3人的活后分钱,水]
Three Families Three families share a garden. They usually clean the garden together at the end o ...
- ACM_水题你信吗
水题你信吗 Time Limit: 2000/1000ms (Java/Others) Problem Description: 某发最近又认识了很多妹(han)子,可是妹(han)子一多不免有时会忘 ...
随机推荐
- 锋利的js之妈妈再也不用担心我找错钱了
用js实现收银功能. <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <hea ...
- WebForm---增删改(内置对象)
一.添加 前台代码: <body> <form id="form1" runat="server"> <h1>用户添加< ...
- git常用操作
批量删除以bran开头的本地分支 git branch |grep 'bran'|xargs git branch -d
- 解决方法:An error occurred on the server when processing the URL. Please contact the system administrator
在WINDOWS7或SERVER2008上安装了IIS7.5,调试ASP程序时出现以下错误: An error occurred on the server when processing the U ...
- 在Hadoop-2.2.0集群上安装 Hive-0.13.1 with MySQL
fesh个人实践,欢迎经验交流!本文Blog地址:http://www.cnblogs.com/fesh/p/3872872.html 软件环境 操作系统:Ubuntu14.04 JDK版本:jdk1 ...
- openssl API网络通信
1.本文是在别人的基础上,经过测试,大体总结的.操作环境ubuntu12和ubuntu14 ****************************************************** ...
- Oracle中Lpad函数和Rpad函数的用法
http://blog.csdn.net/woshixuye/article/details/17262307 一.Lpad函数 lpad函数将左边的字符串填充一些特定的字符其语法格式如下:lpad ...
- Android(Xamarin)之旅(三)
前面两篇说到了Xamarin的安装和一些简单的控件,今天来说说一些对话框和提示信息,以及简单的布局元素. 一.对话框和提示信息 一.对话框 我们首先从简单的对话框开始. 1.普通对话框 在androi ...
- 关于Control flow
1.一个package包含一个control flow并且一个或多个data flow. (这个项目叫做 Integration services project,提供了三种不同类型的control ...
- Struts2中请求参数的接收方式和ModelDriven机制及其运用
odelDriven 为什么需要ModelDriven 所谓ModelDriven,意思是直接把实体类当成页面数据的收集对象.比如,有实体类User如下: package cn.com.leadfar ...