[old] Saw the Stick

[old] Saw the Stick

Undefined
DE EN 日本語

巨大な子犬が大きな丸い瞳で彼女を見下ろしており、 彼女に触ろうとして脚をそろりと伸ばしてきました。 「可哀想な子!」彼女はなだめる様にいい、頑張って口笛をふいてやりました。 しかし子犬がお腹をすかしていて彼女を食べようとしており 全ては無駄に終わるのではと思い内心大変怖がっていたのです。

彼女は特に考えも無しに棒切れを拾って子犬に差し出してみると、 ...

「不思議の国からのパズル」ルイス・キャロル

ロボット達は棒切れをいくつかに切り分けたかった。棒切れの長さはNインチである。 我々はロボット達が棒切れを切るのを手伝おう。切れ分けたそれらは整数値の長さとする(1, 2, 3 .. インチ等、1.2は駄目) そして我々は一続きの数字…中でも特に三角数を愛している。 (三角数), あなたは棒切れを一続きの三角数の長さで一番多くの数に切り分けること。 また切り分けた断片は各々異なる長さであること。 例: 6415, 21, 28に切り分けるべきである。 なぜなら 28, 36 はそれより少ないし、 1, 3, 15, 45 は連続した三角数でないからである。

あなたには棒切れの長さ(N)が与えられる。 解答は昇順の整数値のリストで返すこと。 もし解がなければ空のリストを返すこと。.

sawing sawing

入力: 棒切れの長さ(integer型)

出力: 三角数の断片(integer型のリスト) または空のリスト

例:

stick(64) == [15, 21, 28]
stick(371) == [36, 45, 55, 66, 78, 91]
stick(225) == [105, 120]
stick(882) == []

どのように使われるか: このタスクで三角数について学ぶことができる。 三角数は正三角形型のオブジェクトより勘定される。 この興味深い一連の数値は様々な状況で使われる。
現実での利用例は: リーグ戦として行われる競技での試合回数は三角数 Tn−1で求まる。 例えば参加しているのが4チームなら6試合必要となり、8チームなら28試合必要である。

事前条件n: 0 < length < 1000

You should be an authorized user in order to see the full description and start solving this mission.
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=js 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