結果

問題 No.677 10^Nの約数
ユーザー KisaragiEffectiveKisaragiEffective
提出日時 2020-11-08 21:41:07
言語 Ruby
(3.3.0)
結果
AC  
実行時間 91 ms / 2,000 ms
コード長 293 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 11,364 KB
実行使用メモリ 15,428 KB
最終ジャッジ日時 2023-09-29 21:43:27
合計ジャッジ時間 2,774 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
15,100 KB
testcase_01 AC 91 ms
15,392 KB
testcase_02 AC 85 ms
15,340 KB
testcase_03 AC 86 ms
15,124 KB
testcase_04 AC 86 ms
15,236 KB
testcase_05 AC 90 ms
15,428 KB
testcase_06 AC 86 ms
15,348 KB
testcase_07 AC 86 ms
15,316 KB
testcase_08 AC 87 ms
15,304 KB
testcase_09 AC 85 ms
15,196 KB
testcase_10 AC 89 ms
15,124 KB
testcase_11 AC 87 ms
15,356 KB
testcase_12 AC 87 ms
15,184 KB
testcase_13 AC 87 ms
15,220 KB
testcase_14 AC 87 ms
15,308 KB
testcase_15 AC 87 ms
15,348 KB
testcase_16 AC 86 ms
15,332 KB
testcase_17 AC 86 ms
15,300 KB
testcase_18 AC 86 ms
15,120 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require "prime"
P = 10 ** gets.to_i
if P == 1 then
    puts 1
    exit
end
x = Prime.prime_division(P).map{|x| (0..x[1]).map {|e| x[0] ** e}}
v = x[0].size
puts (0..v).to_a.repeated_permutation(2).to_a.map{|i| [x[0][i[0]], x[1][i[1]]]}.filter {|w| w.none?(&:nil?) }.map{|p| p.reduce(:*)}.sort
0