結果

問題 No.677 10^Nの約数
ユーザー MarioMario
提出日時 2018-06-03 14:46:07
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 522 bytes
コンパイル時間 119 ms
コンパイル使用メモリ 10,776 KB
実行使用メモリ 8,404 KB
最終ジャッジ日時 2023-09-12 21:52:12
合計ジャッジ時間 1,448 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 17 ms
8,160 KB
testcase_02 AC 16 ms
8,340 KB
testcase_03 AC 16 ms
8,336 KB
testcase_04 AC 17 ms
8,332 KB
testcase_05 AC 16 ms
8,192 KB
testcase_06 AC 16 ms
8,196 KB
testcase_07 AC 16 ms
8,200 KB
testcase_08 AC 17 ms
8,220 KB
testcase_09 AC 17 ms
8,360 KB
testcase_10 AC 16 ms
8,332 KB
testcase_11 AC 16 ms
8,268 KB
testcase_12 AC 16 ms
8,364 KB
testcase_13 AC 16 ms
8,348 KB
testcase_14 AC 17 ms
8,260 KB
testcase_15 AC 16 ms
8,184 KB
testcase_16 AC 16 ms
8,276 KB
testcase_17 AC 17 ms
8,196 KB
testcase_18 AC 16 ms
8,360 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import product
from operator import mul

def f1(n):
    fct = []
    b, e = 2, 0
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))

    return fct

def f2(fcts):
    l = []
    for f, n in fcts:
        l.append([f ** i for i in range(n+1)])
    return l

fcts = f2(f1(10 ** int(input())))
print(*sorted([mul(*i) for i in product(*fcts)]), sep="\n")
0