結果

問題 No.414 衝動
ユーザー 👑 yumechiyumechi
提出日時 2016-08-27 00:01:55
言語 Ruby
(3.3.0)
結果
RE  
実行時間 -
コード長 188 bytes
コンパイル時間 267 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 12,928 KB
最終ジャッジ日時 2024-04-26 04:11:59
合計ジャッジ時間 3,976 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 AC 199 ms
12,672 KB
testcase_06 AC 199 ms
12,672 KB
testcase_07 RE -
testcase_08 AC 155 ms
12,544 KB
testcase_09 RE -
testcase_10 AC 99 ms
12,544 KB
testcase_11 RE -
testcase_12 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require 'prime'

i = gets.chomp.to_i
a = i.prime_division.map {|p,n| [p]*n }.flatten
if a.size == 1
    puts "1 #{a[0]}"
else
    i = a.inject{|s,n| sum*n}/a[0]
    puts "#{a[0]} #{i}"
end
0