hdu 3434 给你含有n个数的序列,每次你可以选一个子序列将上面所有的数字加1或者减1,目标是把所有数字变成相同的,问最少步数,和那个相同的数字有多少种可能

该博客讨论了如何找到一个包含n个数的序列,通过加1或减1操作使得所有数字变为相同的最少数目,同时计算这种相同数字的可能种类。文章提供了一个C++程序实现解决方案,通过计算相邻元素的差值和,确定最小步数和可能的相同数字数量。
摘要由CSDN通过智能技术生成

Problem Description
Given a sequence consists of N integers. Each time you can choose a continuous subsequence and add 1 or minus 1 to the numbers in the subsequence .You task is to make all the numbers the same with 
the least tries. You should calculate the number of the least tries 
you needed and the number of different final sequences with the least tries.
 

Input
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值