No.3028 No.9999
レベル :
/ AI推定難易度 : 800
/ 実行時間制限 : 1ケース 4.000秒 / メモリ制限
: 512 MB / 標準ジャッジ問題
タグ : / 解いたユーザー数 75
作問者 :
ジュ・ビオレ・グレイス
/ テスター :
👑
p-adic
タグ : / 解いたユーザー数 75
作問者 :
ジュ・ビオレ・グレイス
/ テスター :
👑
問題文最終更新日: 2025-02-06 00:26:59
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 457
(順位表)
の他の問題:
Note
The execution time limit for this problem is 4000ms.
Problem Statement
You are given a positive integer $N$ that is divisible by neither 2 nor 5. It can then be shown that there exists a positive integer $K$ such that $N$ divides $10^K - 1$. Output the smallest such $K$.
Input
$N$
$1 \leq N \leq 10^8$
Here, $N$ is neither a multiple of 2 nor a multiple of 5.
Output
Print a newline at the end.
Sample
Sample 1
Input
1111
Output
4
$1111 \times 9 = 9999 = 10^4 - 1$.
Sample 2
Input
7
Output
6
None of $9, 99, 999, 9999, 99999$ is divisible by $7$, but $999999 = 142857 \times 7$ is divisible by $7$.
Sample 3
Input
13
Output
6
None of $9, 99, 999, 9999, 99999$ is divisible by $13$, but $999999 = 76923 \times 13$ is divisible by $13$.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。