結果

問題 No.677 10^Nの約数
ユーザー kept1994kept1994
提出日時 2021-09-29 03:01:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 112 ms / 2,000 ms
コード長 623 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 87,232 KB
実行使用メモリ 75,608 KB
最終ジャッジ日時 2023-09-23 00:00:07
合計ジャッジ時間 2,831 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
71,160 KB
testcase_01 AC 76 ms
71,360 KB
testcase_02 AC 76 ms
71,320 KB
testcase_03 AC 75 ms
71,068 KB
testcase_04 AC 76 ms
71,460 KB
testcase_05 AC 76 ms
71,196 KB
testcase_06 AC 76 ms
71,128 KB
testcase_07 AC 76 ms
71,248 KB
testcase_08 AC 81 ms
71,580 KB
testcase_09 AC 82 ms
75,536 KB
testcase_10 AC 79 ms
75,488 KB
testcase_11 AC 80 ms
75,408 KB
testcase_12 AC 79 ms
75,608 KB
testcase_13 AC 79 ms
75,520 KB
testcase_14 AC 80 ms
75,304 KB
testcase_15 AC 82 ms
75,200 KB
testcase_16 AC 85 ms
75,408 KB
testcase_17 AC 94 ms
75,408 KB
testcase_18 AC 112 ms
75,280 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
import sys

def main():
    N = int(input())
    def getDivisors(n: int):
        lowerDivisors, upperDivisors = [], []
        i = 1
        while i * i <= n: # sqrt(N)まで試し割りする。
            if n % i == 0:
                lowerDivisors.append(i)
                if i != n // i:
                    upperDivisors.append(n//i)
            i += 1
        return lowerDivisors + upperDivisors[::-1]

    aa = getDivisors(2 ** N)
    bb = getDivisors(5 ** N)
    ans = sorted([i * j for i in aa for j in bb])
    print(*ans ,sep="\n")    
    return
if __name__ == '__main__':
    main()
0