ZOJ-Hard to Play


题目

MightyHorse is playing a music game called osu!.

After playing for several months, 

MightyHorse discovered the way of calculating score inosu!:

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 theith circle, Combo should bei - 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 playingosu!

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 andC (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 <bits/stdc++.h>//(注意此题中的i<th>,由此可推得先加50分,再加100、300可得最大分值,反之得最小分值)
using namespace std;
int main()
{
    int T;
    while(scanf("%d",&T)!=EOF)
    {
        while(T--)
        {
            int a,b,c;
            scanf("%d%d%d",&a,&b,&c);
           int num=a+b+c;
           int i;
           int ma=0,mi=0;
           for(i=0;i<num;i++)
           {
               if(i<c)
               {
                   ma=ma+50*(i*2+1);
               }
               else if(i>=c&&i<b+c)
               {
                   ma=ma+100*(i*2+1);
               }
               else if(i>=b+c)
               {
                   ma=ma+300*(i*2+1);
               }
               if(i<a)
               {
                   mi=mi+300*(i*2+1);
               }
               else if(i>=a&&i<a+b)
               {
                   mi=mi+100*(i*2+1);
               }
               else if(i>=b+a)
               {
                   mi=mi+50*(i*2+1);
               }
           }
           printf("%d %d\n",mi,ma);
        }
    }
    return 0;
}


内容概要:本文详细介绍了一个基于Java和Vue的联邦学习隐私保护推荐系统的设计与实现。系统采用联邦学习架构,使用户数据在本地完成模型训练,仅上传加密后的模型参数或梯度,通过中心服务器进行联邦平均聚合,从而实现数据隐私保护与协同建模的双重目标。项目涵盖完整的系统架构设计,包括本地模型训练、中心参数聚合、安全通信、前后端解耦、推荐算法插件化等模块,并结合差分隐私与同态加密等技术强化安全性。同时,系统通过Vue前端实现用户行为采集与个性化推荐展示,Java后端支撑高并发服务与日志处理,形成“本地训练—参数上传—全局聚合—模型下发—个性化微调”的完整闭环。文中还提供了关键模块的代码示例,如特征提取、模型聚合、加密上传等,增强了项目的可实施性与工程参考价值。 适合人群:具备一定Java和Vue开发基础,熟悉Spring Boot、RESTful API、分布式系统或机器学习相关技术,从事推荐系统、隐私计算或全栈开发方向的研发人员。 使用场景及目标:①学习联邦学习在推荐系统中的工程落地方法;②掌握隐私保护机制(如加密传输、差分隐私)与模型聚合技术的集成;③构建高安全、可扩展的分布式推荐系统原型;④实现前后端协同的个性化推荐闭环系统。 阅读建议:建议结合代码示例深入理解联邦学习流程,重点关注本地训练与全局聚合的协同逻辑,同时可基于项目架构进行算法替换与功能扩展,适用于科研验证与工业级系统原型开发。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值