結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 16 ms
8,272 KB
testcase_02 AC 17 ms
8,220 KB
testcase_03 AC 17 ms
8,216 KB
testcase_04 AC 17 ms
8,324 KB
testcase_05 AC 16 ms
8,332 KB
testcase_06 AC 16 ms
8,284 KB
testcase_07 AC 16 ms
8,224 KB
testcase_08 AC 17 ms
8,176 KB
testcase_09 AC 16 ms
8,204 KB
testcase_10 AC 17 ms
8,184 KB
testcase_11 AC 17 ms
8,300 KB
testcase_12 AC 17 ms
8,192 KB
testcase_13 AC 16 ms
8,240 KB
testcase_14 AC 16 ms
8,244 KB
testcase_15 AC 16 ms
8,224 KB
testcase_16 AC 16 ms
8,416 KB
testcase_17 AC 16 ms
8,344 KB
testcase_18 AC 16 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