結果

問題 No.1339 循環小数
ユーザー ygd.
提出日時 2021-01-15 21:57:23
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 336 bytes
コンパイル時間 147 ms
コンパイル使用メモリ 82,212 KB
実行使用メモリ 120,404 KB
最終ジャッジ日時 2024-11-26 14:31:28
合計ジャッジ時間 50,499 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 20 TLE * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

Case = int(input())
for _ in range(Case):
    N = int(input())
    while N%2 == 0:
        N //= 2
    while N%5 == 0:
        N //= 5
    ans = 1
    base = 9; keta = 1
    while base%N != 0:# and ans < 100:
        base %= N
        keta *= 10; keta %= N
        base += keta*9
        ans += 1
        #print(base,ans)
    print(ans)
0