No.3353 Computing Liouville's Constant
タグ : / 解いたユーザー数 72
作問者 : 👑
Problem Statement
You are given a positive integer $N$.
Liouville's constant is the real number defined by the infinite sum
$\displaystyle \sum_{i=1}^{\infty} 10^{-i!} $
and it is uniquely represented as a decimal fraction in base ten as
0.1100010000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010...
(shown up to the $121$-st digit after the decimal point).
Find the $N$-th digit after the decimal point of Liouville's constant.
Input
The input is given from standard input in $1$ line in the following format:
- Line $1$ contains $N$.
$N$
Constraints
The input satisfies the following constraints:
- $N$ is an integer satisfying $1 \leq N \leq 100$.
Output
Print the $N$-th digit after the decimal point of Liouville's constant in $1$ line.
Print a newline at the end.
Sample
Sample 1
Input
1
Output
1
The $1$-st digit after the decimal point of $0.1100010000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010 \cdots$ is $1$.
Sample 2
Input
2
Output
1
The $2$-nd digit after the decimal point of $0.1100010000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010 \cdots$ is $1$.
Sample 3
Input
3
Output
0
The $3$-rd digit after the decimal point of $0.1100010000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010 \cdots$ is $0$.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。