[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)子一多不免有时会忘 ...
随机推荐
- jquery table 拼接集合
1html: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <ti ...
- 8.Mybatis的延迟加载
在Mybatis中的延迟加载只有resultMap可以实现,ResultMap 可以实现高级映射(association,collection可以实现一对1和一对多的映射),他们具有延迟加载的功能,r ...
- LinQ 高级查询
高级查询 模糊查(包含):.Contains(name) 开头:.StartsWith(name) 结尾:.EndsWith(name) 个数:.Count() 最大值:Max(r => r.p ...
- MYSQL服务器字符集设置
修改默认字符集 vi /etc/my.cnf 在[mysqld]下面加入default-character-set=utf8 在[client]下面加入default-character-set=ut ...
- nginx反向代理编译异常
cc1: warnings being treated as errors /root/nginx_tcp_proxy_module/ngx_tcp.c: 在函数‘ngx_tcp_add_addrs’ ...
- poj 3368 Frequent values(RMQ)
/************************************************************ 题目: Frequent values(poj 3368) 链接: http ...
- AsyncTask异步加载和Gson
public class MainActivity extends Activity { private List<Goods> goods=new ArrayList<Goo ...
- PostGreSQL存储过程
1 返回结果集的存储过程 -- drop FUNCTION getall();CREATE or REPLACE FUNCTION getall() RETURNS SETOF users AS$B ...
- bugly使用
导入: 1.Bugly.framework 2.Security.framework 3.SystemConfiguration.framework 4.libc++.1.dylib 5.libz.1 ...
- Ext开场布局设计Viewport
//加载dwr dwr.engine.setAsync(false); //***************************************框架定义部分***************** ...