結果

問題 No.677 10^Nの約数
ユーザー finefine
提出日時 2018-04-27 22:29:58
言語 Ruby
(3.3.0)
結果
AC  
実行時間 94 ms / 2,000 ms
コード長 266 bytes
コンパイル時間 229 ms
コンパイル使用メモリ 11,340 KB
実行使用メモリ 15,424 KB
最終ジャッジ日時 2023-09-10 06:25:25
合計ジャッジ時間 3,430 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
15,352 KB
testcase_01 AC 91 ms
15,216 KB
testcase_02 AC 92 ms
15,272 KB
testcase_03 AC 91 ms
15,148 KB
testcase_04 AC 90 ms
15,408 KB
testcase_05 AC 93 ms
15,340 KB
testcase_06 AC 93 ms
15,304 KB
testcase_07 AC 92 ms
15,392 KB
testcase_08 AC 93 ms
15,336 KB
testcase_09 AC 91 ms
15,188 KB
testcase_10 AC 93 ms
15,424 KB
testcase_11 AC 92 ms
15,148 KB
testcase_12 AC 94 ms
15,208 KB
testcase_13 AC 92 ms
15,272 KB
testcase_14 AC 93 ms
15,152 KB
testcase_15 AC 92 ms
15,316 KB
testcase_16 AC 92 ms
15,240 KB
testcase_17 AC 92 ms
15,320 KB
testcase_18 AC 93 ms
15,180 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require 'prime'

def divisor_list(x)
    return [] if x <= 0
    return [1] if x == 1

    x.prime_division.map{|e| [*(0..e.last)].map{|v| e.first ** v }}.inject{|res, e| res.map{|t| e.map{|v| t * v}}.flatten}.sort
end

n = gets.to_i
a = divisor_list(10 ** n)
puts a
0