登录
首页 » 算法 » 数列计算

数列计算

于 2022-03-12 发布 文件大小:293.00 B
0 233
下载积分: 2 下载次数: 1

代码说明:

例如,当k=3时,这个序列是: 1,3,4,9,10,12,13,… (该序列实际上就是:3^0,3^1,3^0+3^1,3^2,3^0+3^2,3^1+3^2, 3^0+3^1+3^2,…) 请你求出这个序列的第N项的值(用10进制数表示)。 例如,对于k=3,N=100,正确答案应该是981。 输入格式 输入只有1行,为2个正整数,用一个空格隔开: k N (k、N的含义与上述的问题描述一致,且3≤k≤15,10≤N≤1000)。 输出格式 输出为计算结果,是一个正整数(在所有的测试数据中,结果均不超过2.1*10^9)。(整数前不要有空格和其他符号)。 样例输入 3 100 样例输出 981  

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • featflow1.3RC10, finite element
    featflow1.3RC10,有限元-流体,老外开发的,不错。-featflow1.3RC10, finite element- fluid, foreign development, yes.
    2022-04-25 10:00:34下载
    积分:1
  • k-means 算法的工作过程说明如下:首先从n个数据对象任意选择 k 个对象作为初始聚类中心;而对于所剩下其它对象,则根据它们与这些聚类中心的相似度(距离),分别将它们分配给与其最相似的(聚类中心所代表的)聚类;然后再计算每个所获新聚类的聚类中心(该聚类中所有对象的均值);不断重复这一过程直到标准测度函数开始收敛为止。-k-means algorithm process as follows: First of all, the object data from the n choose k object as initial cluster centers and the remaining for the other object, then according to their cluster center with those of the similarity (distance) respectively assigned to them with the most similar (represented by cluster center) clustering obtained and then calculated for each new cluster center clustering (all objects in the cluster mean) repeated this process until the standard measure of function until the beginning of convergence.
    2023-07-14 07:15:02下载
    积分:1
  • Linear least square method. X with a general power series to fit.
    线形最小二乘法拟合。用一个一般的X的幂级数来拟合。-Linear least square method. X with a general power series to fit.
    2022-01-28 21:21:18下载
    积分:1
  • 最件单的求值问题..就是求井深和绳长的问题,,我还是个初学者...
    最件单的求值问题..就是求井深和绳长的问题,,我还是个初学者-most pieces of the single-issue .. evaluates depth and is seeking a long rope, and I was a beginner, and laughter
    2022-07-19 00:03:09下载
    积分:1
  • 用C编写的迷宫最短路径。另有一用VC编写的
    用C编写的迷宫最短路径。另有一用VC编写的-C maze prepared by the shortest path. Another one prepared by the VC
    2022-08-20 23:22:59下载
    积分:1
  • TC35板子上单片机短信控制继电器源程序
    TC35板子将单片机与GSM短信模块级联在一起 此代码详细描述了怎样通过手机向GSM模块发短信以通过单片机控制继电器
    2022-12-08 12:00:08下载
    积分:1
  • 计算地球或椭圆体中两点距离的程序
    计算地球或椭圆体中两点距离的程序-A program which can calculate the instance of two points in the earth or the elipse
    2022-05-19 14:58:07下载
    积分:1
  • 最小二乘法一般是用来拟合直线和一些线性数据的,就是用一条直线来尽可能的表达若干的点的趋势,当然直线穿过所有的点是最好的,但往往有误差存在,所以拟合出的直线要求误...
    最小二乘法一般是用来拟合直线和一些线性数据的,就是用一条直线来尽可能的表达若干的点的趋势,当然直线穿过所有的点是最好的,但往往有误差存在,所以拟合出的直线要求误差最小.设这些点为(x1,y1),(x2,y2)....(xn,yn).拟合直线为y=kx+b.-Ordinary least squares method is used to fit a straight line and a number of linear data, that is, as far as possible with a straight line to the point of the expression of a number of trends, of course, a straight line through all the points is the best, but often there is a margin of error, Therefore, a straight line fitting the requirements of the smallest error. established for these points (x1, y1), (x2, y2 )....( xn, yn). fitting straight line y = kx+ b.
    2022-08-05 10:47:25下载
    积分:1
  • 点到线段距离,在进行画图时,在选择线时有重要作用,
    点到线段距离,在进行画图时,在选择线时有重要作用,-Point to a line distance
    2022-12-25 12:00:03下载
    积分:1
  • 改进的leach协议算法
    LEACH算法是一种无线传感器网络路由协议,leach协议算法基本思想是:以循环的方式随机选择簇头节点,将整个网络的能量负载平均分配到每个传感器节点中,从而达到降低网络能源消耗、提高网络整体生存时间的目的。仿真表明,与一般的平面多跳路由协议和静态分层算法相比,LEACH分簇协议可以将网络生命周期延长15%。
    2022-01-25 17:31:49下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载