結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,172 KB
testcase_01 AC 16 ms
8,140 KB
testcase_02 AC 17 ms
8,136 KB
testcase_03 AC 17 ms
8,224 KB
testcase_04 AC 17 ms
8,216 KB
testcase_05 AC 17 ms
8,176 KB
testcase_06 AC 17 ms
8,260 KB
testcase_07 AC 16 ms
8,348 KB
testcase_08 AC 16 ms
8,276 KB
testcase_09 AC 16 ms
8,308 KB
testcase_10 AC 17 ms
8,224 KB
testcase_11 AC 16 ms
8,312 KB
testcase_12 AC 16 ms
8,240 KB
testcase_13 AC 16 ms
8,188 KB
testcase_14 AC 16 ms
8,280 KB
testcase_15 AC 16 ms
8,304 KB
testcase_16 AC 17 ms
8,192 KB
testcase_17 AC 17 ms
8,296 KB
testcase_18 AC 16 ms
8,376 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(1)
else:
    print(*sorted([mul(*i) for i in product(*f2(f1(10 ** n)))]), sep="\n")
0