No.791 Ushi Sequence
問題文最終更新日: 2019-02-22 21:04:03
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
yukicoder contest 206
(順位表)
の他の問題:
Problem Statement
Let the $i$-th term of the sequence $E$ be $E_i = 1\underbrace{333\cdots 3}_{i 個}$ (the number which, in base $10$, is $1$ followed by $i$ occurrences of $3$), where $i$ is a positive integer.
Given an integer $N$, find which term of the sequence $E$ the integer $N$ is.
However, if $N$ does not appear in the sequence $E$, output $-1$.
Input
$N$
$1 \leq N \leq 10^{100}$
$N$ is an integer.
Output
Output the answer on $1$ line. Print a newline at the end.
Sample
Sample 1
Input
1333
Output
3
Sample 2
Input
1334
Output
-1
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
treeone
ei1333333