No.1278 What Kind of Series?
レベル :
/ AI推定難易度 : 2650
/ 実行時間制限 : 1ケース 2.000秒 / メモリ制限
: 512 MB / 小数誤差許容問題 絶対誤差または相対誤差が $10^{-6}$ 以下。ただし、ジャッジ側の都合で500桁未満にしてください
タグ : / 解いたユーザー数 8
作問者 :
PCTprobability
/ テスター :
kozy
タグ : / 解いたユーザー数 8
作問者 :
PCTprobability
/ テスター :
kozy
問題文最終更新日: 2020-11-05 19:20:48
English (AI translation)
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence.
Back to the original
Problem Statement
For a sequence of positive integers $a_1,a_2,...,a_n$, the function $f(a_1,a_2,...,a_n)$ is defined as follows.
$f(1)= \frac{1}{2}$
$a_n \ge 2$ の時、 $f(a_1,a_2,...,a_n)=\left( \displaystyle \sum_{1 < k_1 < k_2 < ... < k_n}^{} \frac{1}{ \displaystyle \prod_{i=1}^n k_i^{a_i} } \right)-f(a_1,a_2,...,a_n-1)$
$a_n=1$ かつ $n \neq 1$ の時、$f(a_1,a_2,...,a_n)=f(a_1,a_2,...,a_{n-1})$
Given positive integers $X,K$, output the following value.
- If $X=1$, compute $f(L)$ for every possible sequence of positive integers $L$ of length $K$, and output their sum.
- If $X=2$, compute $f(Q)$ for every possible sequence of positive integers $Q$ whose elements sum to $K$, and output their sum.
Input
$X$ $K$
- All inputs are integers.
- $X$ is $1$ or $2$.
- $1 \le K \le 10^5$
Output
Output the value requested for the given $X$. Your answer is considered correct if the smaller of the absolute error and the relative error is at most $10^{-6}$.
Sample
Sample 1
Input
1 1
Output
0.75
\(\displaystyle \sum_{i=1}^\infty f(i) \) $=0.75$.
Sample 2
Input
2 2
Output
0.644934033
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。