freeCodeCamp/curriculum/challenges/japanese/10-coding-interview-prep/project-euler/problem-360-scary-sphere.md

1.0 KiB

id title challengeType forumTopicId dashedName
5900f4d41000cf542c50ffe7 問題 360: 恐ろしい球体 5 302021 problem-360-scary-sphere

--description--

三次元空間に (x_1, y_1, z_1) と (x_2, y_2, z_2) の 2 つの点が与えられるとき、この 2 点間のマンハッタン距離は |x_1 - x_2| + |y_1 - y_2| + |z_1 - z_2| と定義されます。

C(r) を、半径が r、中心が原点 O(0, 0, 0) の球とします。

I(r) を、C(r) の表面に整数座標を持つすべての点の集合とします。

S(r) を、I(r) のすべての要素から原点 O までのマンハッタン距離の和とします。

例: S(45)=34518

S({10}^{10}) を求めなさい。

--hints--

scarySphere()878825614395267100 を返す必要があります。

assert.strictEqual(scarySphere(), 878825614395267100);

--seed--

--seed-contents--

function scarySphere() {

  return true;
}

scarySphere();

--solutions--

// solution required