結果

問題 No.1339 循環小数
ユーザー 👑 terry_u16terry_u16
提出日時 2021-01-15 23:08:42
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 566 bytes
コンパイル時間 854 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 214,368 KB
最終ジャッジ日時 2024-05-05 01:03:50
合計ジャッジ時間 21,754 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
88,064 KB
testcase_01 AC 638 ms
207,584 KB
testcase_02 AC 516 ms
208,332 KB
testcase_03 AC 466 ms
208,444 KB
testcase_04 AC 541 ms
208,200 KB
testcase_05 AC 490 ms
213,108 KB
testcase_06 AC 531 ms
213,640 KB
testcase_07 AC 475 ms
214,092 KB
testcase_08 AC 507 ms
214,168 KB
testcase_09 AC 511 ms
208,204 KB
testcase_10 AC 457 ms
208,160 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 684 ms
212,372 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

tests = int(input())

for _ in range(tests):
    # result = []
    mods = []
    n = int(input())
    mod = 1
    for _ in range(100000):
        nxt = mod // n
        mod -= n * nxt
        # result.append(nxt)
        mods.append(mod)
        mod *= 10
    
    for length in range(1, 50001):
        ok = True
        for i in range(1, length + 1):
            # ok &= result[-i] == result[-(i + length)]
            ok = mods[-i] == mods[-(i + length)]
            if not ok:
                break

        if ok:
            print(length)
            break   
0