PLANTING
植树问题,棵数一算就明。
两端都种、只种一端、两端都不种、环形等类型,自动算棵数与间隔数,并提供随机练习判分。
—
—
棵
本页处理在浏览器本地完成
解题动画 · 间隔与棵数
这是什么?
间隔数 = 总长 ÷ 间距。两端都种:棵数 = 间隔数 + 1;只种一端:棵数 = 间隔数;两端都不种:棵数 = 间隔数 − 1;环形:棵数 = 间隔数。
常见问题
四种植树类型怎么区分?
看两端处理:两端都种 → 棵数 = 间隔数 + 1;只种一端 → 棵数 = 间隔数;两端都不种 → 棵数 = 间隔数 − 1;圆形(环形)→ 棵数 = 间隔数。先判断类型再套公式,这是唯一容易错的地方。
间隔数怎么求?
两端都种和两端都不种:间隔数 = 总长 ÷ 间距。环形(封闭):间隔数 = 总长 ÷ 间距。锯木头、爬楼梯、敲钟这类首尾相连的问题也按环形算——总数直接等于间隔数。
不植树的情况怎么处理?
如果某端是楼、墙、湖边等不能种的位置,就归到「两端都不种」或「只种一端」。先在图上标出哪些端能种,再决定用哪个公式,比套公式更快。
示例与注意事项Example & notes
一个例子A worked example
20 米小路每 4 米栽一棵:两端都栽要 6 棵(20÷4+1),只栽一端 5 棵,环形同样 5 棵。A 20 m path planted every 4 m: 6 trees when both ends are planted, 5 with one end, and 5 around a loop.
注意事项Things to watch
- 间隔数 = 总长 ÷ 间距;两端都栽要 +1,这是最常漏的一步。Intervals equal length divided by spacing; planting both ends needs one extra tree — the step people skip.
- 环形没有端点,棵数正好等于间隔数。A loop has no endpoints, so the tree count equals the interval count exactly.
- 锯木头、爬楼梯、敲钟都是同一个模型,可类比记忆。Sawing logs, climbing stairs and ringing bells are the same model — a useful analogy.
相关问答More Q&A
为什么两端都栽要多一棵?Why one more tree at both ends?
因为 n 个间隔对应 n+1 个端点,两个端点各有一棵。Because n intervals have n+1 endpoints, and each endpoint holds a tree.
有图示吗?Is there a diagram?
有,动画会逐段点亮间隔并给每棵树编号。Yes — an animation lights each interval and numbers every tree.