Golden Pyramid

Golden Pyramid

Elementary+
DE EN FR HU JA RU UK 简体中文

我们的机器人 -三重奏需要为未来的旅程和寻宝活动而训练。斯蒂芬已经建立了一个金字塔型的特殊平面模型。现在机器人可以训练用来收集黄金。他们起始于金字塔的顶端,而且必须在每个空间收集黄金,然后选择走左边还是右边的路径,并继续下降到下一层。为了优化他们收集黄金的能力,斯蒂芬需要知道可以在一次运行中收集到的黄金的最大数量。

给你一个由元组组成的元组,其中第一个元组具有一个整数,每下一个元组具有一个比上一个元祖整数个数多一个。这个由元组组成的元组看起来像一个三角形。你需要写一个程序,来帮助史蒂芬在金字塔中找到最赚钱的路线下所收集到黄金的最大数量。下金字塔所有路线是向左下方或者向右下方。

提示: 想想每一步的向左下是移动到相同的索引位置,向右下为移动到更高的索引位置。如果你打算在这里使用递归,要非常注意。

sum-in-triangles

sum-in-triangles

输入: 金字塔作为一个由元组组成的元组。每个元组包含整数(int)。

输出: 能采集的最大黄金量作为整数(int)。

范例:...

You should be an authorized user in order to see the full description and start solving this mission.
45
Settings
Code:
Other:
Invalid hot key. Each hot key should be unique and valid
Hot keys:
CheckiO Extensions

CheckiO Extensions allow you to use local files to solve missions. More info in a blog post.

In order to install CheckiO client you'll need installed Python (version at least 3.8)

Install CheckiO Client first:

pip3 install checkio_client

Configure your tool

checkio --domain=py config --key=

Sync solutions into your local folder

checkio sync

(in beta testing) Launch local server so your browser can use it and sync solution between local file end extension on the fly. (doesn't work for safari)

checkio serv -d

Alternatevly, you can install Chrome extension or FF addon

checkio install-plugin
checkio install-plugin --ff
checkio install-plugin --chromium

Read more here about other functionality that the checkio client provides. Feel free to submit an issue in case of any difficulties.

Pair Programming (Beta-version)

Welcome to Pair Programming! Engage in real-time collaboration on coding projects by starting a session and sharing the provided unique URL with friends or colleagues. This feature is perfect for joint project development, debugging, or learning new skills together. Simply click 'Start Session' to begin your collaborative coding journey!

Waiting for Pair Programming to start...

You are trying to join a pair programming session that has not started yet.

Please wait for the session creator to join.

Waiting for Pair Programming to reconnect...

It looks like the creator of the pair programming session closed the editor window.

It might happen accidentally, so that you can wait for reconnection.

×
 
 
<< <
> >>
exec show

Whats Next?

Free accounts will see Best CheckiO solutions with some delay.
Best Solutions will be opened in a moment
Become Awesome and Don't wait
The next stage is ""
Will be activated in
View More Solutions Random Review Solutions Go to the next mission