結果

問題 No.3028 No.9999
ユーザー flippergo
提出日時 2025-03-04 21:39:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 821 ms / 4,000 ms
コード長 273 bytes
コンパイル時間 507 ms
コンパイル使用メモリ 82,508 KB
実行使用メモリ 59,692 KB
最終ジャッジ日時 2025-03-04 21:39:08
合計ジャッジ時間 5,054 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
if N==1 or N==3 or N==9:
    print(1)
else:
    if N%9==0:
        N = N//9
    elif N%3==0:
        N = N//3
    n = 1
    cnt = 1
    for k in range(2,N+1):
        n = (n*10)%N
        cnt += n
        if cnt%N==0:
            print(k)
            break
0