首页
题库
面试
求职
学习
竞赛
More+
所有博客
搜索面经/职位/试题/公司
搜索
我要招人
去企业版
登录 / 注册
首页
>
试题广场
>
牛牛组数
[编程题]牛牛组数
热度指数:266
时间限制:C/C++ 1秒,其他语言2秒
空间限制:C/C++ 256M,其他语言512M
算法知识视频讲解
牛牛有一个数
,他每次可以在该数的左边加上一个正整数(增加的数不能大于原有数的一半)来组成新的数,不停的循环加直到不能组成新的数为止。
牛牛想知道,对于给定的任意数
,他最多有多少种组法?
示例1
输入
6
输出
6
说明
一共有6种组法,分别为6,16,26,126,36,136
马上挑战
算法知识视频讲解
提交运行
算法知识视频讲解
添加笔记
求解答(0)
邀请回答
收藏(6)
分享
纠错
提交结果有问题?
0个回答
1篇题解
添加回答
这道题你会答吗?花几分钟告诉大家答案吧!
提交观点
问题信息
模拟
难度:
0条回答
6收藏
475浏览
热门推荐
通过挑战的用户
牛客50842...
2021-10-20 13:46:31
想去三亚看海的...
2021-10-20 09:12:34
没有银弹_
2021-10-16 10:50:44
Lovage_
2021-10-11 14:04:49
牛客71017...
2021-10-01 18:01:15
相关试题
一个文件里有10万个随机正整数,按...
去哪儿
堆
模拟
评论
(4)
一个10*10的矩阵(可以理解为棋...
去哪儿
模拟
评论
(0)
有两个文件context.txt和...
去哪儿
模拟
评论
(4)
体育课测验(二)
广度优先搜索(BFS)
拓扑排序
dfs
评论
(2)
PMOS和NMOS的区别
元器件
评论
(1)
扫描二维码,关注牛客网
意见反馈
下载牛客APP,随时随地刷题
import java.util.*; public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * 返回最多满足条件的组法 * @param n int整型 * @return long长整型 */ public long addLeftNumber (int n) { // write code here } }
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * 返回最多满足条件的组法 * @param n int整型 * @return long长整型 */ long long addLeftNumber(int n) { // write code here } };
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # 返回最多满足条件的组法 # @param n int整型 # @return long长整型 # class Solution: def addLeftNumber(self , n ): # write code here
using System; using System.Collections.Generic; class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * 返回最多满足条件的组法 * @param n int整型 * @return long长整型 */ public long addLeftNumber (int n) { // write code here } }
/** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * 返回最多满足条件的组法 * @param n int整型 * @return long长整型 */ function addLeftNumber( n ) { // write code here } module.exports = { addLeftNumber : addLeftNumber };
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # 返回最多满足条件的组法 # @param n int整型 # @return long长整型 # class Solution: def addLeftNumber(self , n ): # write code here
package main /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * 返回最多满足条件的组法 * @param n int整型 * @return long长整型 */ func addLeftNumber( n int ) int64 { // write code here }
/** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * 返回最多满足条件的组法 * @param n int整型 * @return long长整型 */ long long addLeftNumber(int n ) { // write code here }
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # 返回最多满足条件的组法 # @param n int整型 # @return long长整型 # class Solution def addLeftNumber(n) # write code here end end
object Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * 返回最多满足条件的组法 * @param n int整型 * @return long长整型 */ def addLeftNumber(n: Int): Long = { // write code here } }
object Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * 返回最多满足条件的组法 * @param n int整型 * @return long长整型 */ fun addLeftNumber(n: Int): Long { // write code here } }
import java.util.*; public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * 返回最多满足条件的组法 * @param n int整型 * @return long长整型 */ public long addLeftNumber (int n) { // write code here } }
/** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * 返回最多满足条件的组法 * @param n int整型 * @return long长整型 */ export function addLeftNumber(n: number): number { // write code here }
public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * 返回最多满足条件的组法 * @param n int整型 * @return long长整型 */ func addLeftNumber ( _ n: Int) -> Int64 { // write code here } }
struct Solution{ } impl Solution { fn new() -> Self { Solution{} } /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * 返回最多满足条件的组法 * @param n int整型 * @return long长整型 */ pub fn addLeftNumber(&self, n: i32) -> i64 { // write code here } }
6
6