ZOJ 3712 Hard to Play
2015-09-06 13:32
267 查看
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
Sample Output
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
一共有三种数字300,100,50,每个样例中给出数字的个数,公式是P = Point * (Combo * 2 + 1),其中combo是这个数是第几个计算的, 结果中的两个,一个是从左到右计算,另一个是从又到左计算
#include <iostream> #include <cstring> #include <cstdio> using namespace std; char a[3000008]; int main() { int a,b,c,s,i,j,k,t,l,sum; cin>>t; while(t--) { cin>>a>>b>>c; l=a+b+c; sum=0; for(i=0;i<l;i++) { if(i<a) { sum+=300*(i*2+1); } else if(i<a+b) { sum+=100*(i*2+1); } else sum+=50*(i*2+1); } cout<<sum<<" "; sum=0; for(i=0;i<l;i++) { if(i<c) { sum+=50*(i*2+1); } else if(i<c+b) { sum+=100*(i*2+1); } else sum+=300*(i*2+1); } cout<<sum<<endl; } return 0; }
相关文章推荐
- xdlove的暑期实践总结(大二篇)
- vsftpd的配置详解(中文说明)
- java 大数加减法(小数,正负)
- maven学习笔记(基本的命令和概念)
- SpringMVC中使用Interceptor拦截器
- Java Serializable(序列化)的理解和总结
- linux(centos)搭建SVN服务器
- 数据结构基础 链表的插入排序程序
- mysql 判断 字段是否为空
- [Android]反编译apk + eclipse中调试smali
- String详解, String和CharSequence区别, StringBuilder和StringBuffer的区别 (String系列之1)
- as3.0----Matrix的使用(旋转Sprite)
- PHP安装pthreads多线程扩展教程[windows篇]
- UI初级之常用UI控件UILabl 与 UIButton
- sort 命令--linux
- 剑指Offer系列---(4)实现Singleton模式
- Objective-C Runtime 运行时:成员变量(ivars)及属性
- 记一道很蛋疼的笔试题
- JAR包不全!Unable to load configuration.-bean-jar:file:/.../struts2-core-2.2.1.jar!/struts-default.xml:7
- C#生成不重复随机数的方法