[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)子一多不免有时会忘 ...
随机推荐
- 理解angularjs的作用域
<!doctype html> <html ng-app="myApp"> <head> <script src="http:/ ...
- ted be grateful
-------------------------------------------------------------- David Steindl-Rast: Want to be happy? ...
- sed命令手册
sed 是一种在线编辑器,它一次处理一行内容. 处理时,把当前处理的行存储在临时缓冲区中,称为“模式空间”(pattern space). 接着用sed命令处理缓冲区中的内容,处理完成后,把缓冲区的内 ...
- 开发Android应用怎么更改LOGO图标
开发安卓应用怎么更改LOGO图标,我们知道我们开发安卓程序的时候,都需要给他整一个logo,一般开发程序都会自动一个图标,我们怎么给他更换自己想要的logo图标,之前大家看过我们写的怎么安装程序到虚拟 ...
- Light OJ 1019 - Brush (V)(图论-dijkstra)
题目链接:http://www.lightoj.com/volume_showproblem.php?problem=1019 题目大意:Tanvir想从节点1的位置走到节点n的位置, 输出最短距离, ...
- static关键字用法
java中static关键字可用于修饰: 1.属性:表示该属性变量在类被加载时即被创建并初始化,类加载过程只进行一次,因此静态变量也只被创建一次 2.方法:静态方法为类的公有方法,可直接用‘类名.方法 ...
- 503 Service Temporarily Unavailable
503 Service Temporarily Unavailable 最近网站刷新后经常出现503 Service Temporarily Unavailable错误,有时有可以,联想到最近在ngi ...
- 设置阿里云maven中央仓库的settings.xml
本来想找一个可用的设置文件,结果乱七八糟的,干脆自己做了一个,同时还放上了Spring的SNAPSHOT和MILESTONE/RELEASE仓库,希望能帮到一些人. <?xml version= ...
- 11 个 Linux 上最佳的图形化 Git 客户端
Git是软件开发和若干其他版本控制任务免费和开源的分布式版本控制系统.它被设计用来以应付一切从小到非常大的项目,基于速度,效率和数据完整性. Linux用户主要通过命令行管理Git,不过,一些图形用户 ...
- jQuery中.attr()和.prop()的区别
之前学习jQuery的时候,学习到了两种取得标签的属性值的方法:一种是elemJobj.attr(),另一种是elemJobj.prop().而在学习JS的时候,只有一种方法elemObj.getAt ...