zoukankan      html  css  js  c++  java
  • zoj3712 Hard to Play

    Hard to Play

    Time Limit: 2 Seconds      Memory Limit: 65536 KB

    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

    //简单题,秒
    #include<cstdio>
    #include<cmath>
    #include<cstring>
    #include<algorithm>
    #include<iostream>
    using namespace std;
    int main()
    {
        int  t;
        scanf("%d",&t);
        int num1,num2,num3;
        while(t--)
        {
            scanf("%d%d%d",&num1,&num2,&num3);
            int i,j,k;
            int mmax,mmin;
            mmax=mmin=0;
            for(i=0;i<num1;i++)
                mmin+=300*(i*2+1);
            for(j=i;j<num1+num2;j++)
                mmin+=100*(j*2+1);
            for(k=j;k<num1+num2+num3;k++)
                mmin+=50*(k*2+1);
            for(i=0;i<num3;i++)
                mmax+=50*(i*2+1);
            for(j=i;j<num3+num2;j++)
                mmax+=100*(j*2+1);
            for(k=j;k<num1+num2+num3;k++)
                mmax+=300*(k*2+1);
                printf("%d %d\n",mmin,mmax);
        }
        return 0;
    }

  • 相关阅读:
    《深入理解Java虚拟机》笔记--第四章、虚拟机性能监控与故障处理工具
    《深入理解Java虚拟机》笔记--第三章 、垃圾收集器与内存分配策略
    《深入理解Java虚拟机》笔记--第二章、Java内存区域与内存溢出异常
    Netty并发优化之ExecutionHandler
    Netty框架入门
    123
    如何清理任务栏程序预览的历史记录?
    三个安装,看VIP电影
    WIN 10 COM surrogate 关闭
    微软官方win10系统安装u盘启动盘制作
  • 原文地址:https://www.cnblogs.com/zafuacm/p/3089486.html
Copyright © 2011-2022 走看看