結果

問題 No.677 10^Nの約数
ユーザー simansiman
提出日時 2020-05-07 17:31:19
言語 Ruby
(3.3.0)
結果
AC  
実行時間 91 ms / 2,000 ms
コード長 354 bytes
コンパイル時間 38 ms
コンパイル使用メモリ 11,448 KB
実行使用メモリ 15,608 KB
最終ジャッジ日時 2023-09-16 08:01:35
合計ジャッジ時間 3,142 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
15,556 KB
testcase_01 AC 90 ms
15,560 KB
testcase_02 AC 90 ms
15,360 KB
testcase_03 AC 89 ms
15,400 KB
testcase_04 AC 90 ms
15,544 KB
testcase_05 AC 90 ms
15,344 KB
testcase_06 AC 90 ms
15,528 KB
testcase_07 AC 90 ms
15,564 KB
testcase_08 AC 90 ms
15,308 KB
testcase_09 AC 90 ms
15,304 KB
testcase_10 AC 90 ms
15,504 KB
testcase_11 AC 89 ms
15,328 KB
testcase_12 AC 89 ms
15,400 KB
testcase_13 AC 90 ms
15,476 KB
testcase_14 AC 91 ms
15,608 KB
testcase_15 AC 89 ms
15,336 KB
testcase_16 AC 91 ms
15,304 KB
testcase_17 AC 89 ms
15,556 KB
testcase_18 AC 90 ms
15,460 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

class Integer
  def divisor_list
    require 'prime'

    return [] if self <= 0
    return [1] if self == 1

    prime_division.map.with_index { |(base, k), i|
      s = i.zero? ? 0 : 1
      (s..k).map { |n| base ** n }
    }.inject { |res, e| res + res.flat_map { |t| e.map { |v| t * v } } }.sort
  end
end

N = gets.to_i

puts (10 ** N).divisor_list
0