freeCodeCamp/curriculum/challenges/chinese/08-coding-interview-prep/project-euler/problem-143-investigating-t...

1.6 KiB
Raw Blame History

id challengeType title videoUrl localeTitle
5900f3fc1000cf542c50ff0e 5 Problem 143: Investigating the Torricelli point of a triangle 问题143研究三角形的Torricelli点

Description

设ABC为三角形所有内角均小于120度。设X为三角形内的任意点并使XA = pXC = qXB = r。 Fermat挑战Torricelli找到X的位置使p + q + r最小化。 Torricelli能够证明如果在三角形ABC的每一侧构造等边三角形AOBBNC和AMC则AOBBNC和AMC的外接圆将在三角形内的单个点T处相交。此外他证明了T称为Torricelli / Fermat点最小化p + q + r。更值得注意的是可以证明当总和最小化时AN = BM = CO = p + q + r并且ANBM和CO也在T处相交。

如果总和最小化并且abcpq和r都是正整数我们将称三角形ABC为Torricelli三角形。例如a = 399b = 455c = 511是Torricelli三角形的示例其中p + q + r = 784.找到Torricelli三角形的p + q +r≤120000的所有不同值的总和。

Instructions

Tests

tests:
  - text: <code>euler143()</code>应返回30758397。
    testString: 'assert.strictEqual(euler143(), 30758397, "<code>euler143()</code> should return 30758397.");'

Challenge Seed

function euler143() {
  // Good luck!
  return true;
}

euler143();

Solution

// solution required