結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 17 ms
8,208 KB
testcase_02 AC 19 ms
8,148 KB
testcase_03 AC 17 ms
8,212 KB
testcase_04 AC 17 ms
8,168 KB
testcase_05 AC 17 ms
8,324 KB
testcase_06 AC 17 ms
8,224 KB
testcase_07 AC 17 ms
8,144 KB
testcase_08 AC 17 ms
8,152 KB
testcase_09 AC 16 ms
8,316 KB
testcase_10 AC 17 ms
8,228 KB
testcase_11 AC 17 ms
8,224 KB
testcase_12 AC 17 ms
8,264 KB
testcase_13 AC 17 ms
8,156 KB
testcase_14 AC 17 ms
8,220 KB
testcase_15 AC 18 ms
8,272 KB
testcase_16 AC 17 ms
8,280 KB
testcase_17 AC 17 ms
8,244 KB
testcase_18 AC 17 ms
8,236 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

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