文件名称:ACM-magicANDlawn
介绍说明--下载内容均来自于网络,请自行研究使用
假设有n根柱子,现要按下述规则在这n根柱子中依次放入编号为1,2,3,...的球。
(1)每次只能在某根柱子的最上面放球。
(2)在同一根柱子中,任何2个相邻球的编号之和为完全平方数。
试设计一个算法,计算出在n根柱子上最多能放多少个球。例如,在4 根柱子上最多可
放11 个球。
编程任务:
对于给定的n,计算在n根柱子上最多能放多少个球。-Suppose there are n pillars, according to the following rules are in this n pillars placed sequentially numbered 1,2,3, ... balls.
(1) Each time only in the top of a pillar to put the ball.
(2) In the same pillar, any two adjacent numbers of balls for the perfect square.
Try to design an algorithm to calculate the n pillars can put up to how many balls. For example, in a maximum of four pillars
Put 11 balls.
Programming tasks:
For a given n, compute the n pillars can put up to how many balls.
(1)每次只能在某根柱子的最上面放球。
(2)在同一根柱子中,任何2个相邻球的编号之和为完全平方数。
试设计一个算法,计算出在n根柱子上最多能放多少个球。例如,在4 根柱子上最多可
放11 个球。
编程任务:
对于给定的n,计算在n根柱子上最多能放多少个球。-Suppose there are n pillars, according to the following rules are in this n pillars placed sequentially numbered 1,2,3, ... balls.
(1) Each time only in the top of a pillar to put the ball.
(2) In the same pillar, any two adjacent numbers of balls for the perfect square.
Try to design an algorithm to calculate the n pillars can put up to how many balls. For example, in a maximum of four pillars
Put 11 balls.
Programming tasks:
For a given n, compute the n pillars can put up to how many balls.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
magic-ball.c
Lawn drainage.c