43 lines
916 B
Markdown
43 lines
916 B
Markdown
![]() |
---
|
||
|
id: 5900f42b1000cf542c50ff3d
|
||
|
title: '問題 190: 加重積を最大化する'
|
||
|
challengeType: 5
|
||
|
forumTopicId: 301828
|
||
|
dashedName: problem-190-maximising-a-weighted-product
|
||
|
---
|
||
|
|
||
|
# --description--
|
||
|
|
||
|
$x_1 + x_2 + \cdots + x_m = m$ であり、$P_m = x_1 \times {x_2}^2 \times \cdots \times {x_m}^m$ が最大化される $m$ 個組の正の実数を、$S_m = (x_1, x_2, \ldots, x_m)$ と定義します。
|
||
|
|
||
|
例えば、$[P_{10}] = 4112$ であることを確認できます ([ ] は整数部の関数)。
|
||
|
|
||
|
$2 ≤ m ≤ 15$ のとき、$\sum {[P_m]}$ を求めなさい。
|
||
|
|
||
|
# --hints--
|
||
|
|
||
|
`maximisingWeightedProduct()` は `371048281` を返す必要があります。
|
||
|
|
||
|
```js
|
||
|
assert.strictEqual(maximisingWeightedProduct(), 371048281);
|
||
|
```
|
||
|
|
||
|
# --seed--
|
||
|
|
||
|
## --seed-contents--
|
||
|
|
||
|
```js
|
||
|
function maximisingWeightedProduct() {
|
||
|
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
maximisingWeightedProduct();
|
||
|
```
|
||
|
|
||
|
# --solutions--
|
||
|
|
||
|
```js
|
||
|
// solution required
|
||
|
```
|