結果

問題 No.537 ユーザーID
ユーザー simansiman
提出日時 2020-07-03 12:35:36
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 352 bytes
コンパイル時間 333 ms
コンパイル使用メモリ 11,472 KB
実行使用メモリ 15,664 KB
最終ジャッジ日時 2023-10-14 22:45:16
合計ジャッジ時間 5,827 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
15,532 KB
testcase_01 AC 87 ms
15,456 KB
testcase_02 AC 88 ms
15,436 KB
testcase_03 AC 85 ms
15,412 KB
testcase_04 AC 86 ms
15,400 KB
testcase_05 AC 87 ms
15,576 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 85 ms
15,564 KB
testcase_10 AC 87 ms
15,396 KB
testcase_11 AC 87 ms
15,560 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 86 ms
15,352 KB
testcase_19 AC 88 ms
15,308 KB
testcase_20 AC 173 ms
15,316 KB
testcase_21 AC 87 ms
15,400 KB
testcase_22 AC 86 ms
15,404 KB
testcase_23 AC 86 ms
15,448 KB
testcase_24 AC 86 ms
15,504 KB
testcase_25 AC 84 ms
15,404 KB
testcase_26 AC 85 ms
15,332 KB
testcase_27 AC 85 ms
15,500 KB
testcase_28 AC 87 ms
15,404 KB
testcase_29 AC 89 ms
15,380 KB
testcase_30 AC 88 ms
15,508 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 N.divisor_list.size
0