結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 AC 209 ms
12,672 KB
testcase_06 AC 206 ms
12,672 KB
testcase_07 RE -
testcase_08 AC 160 ms
12,800 KB
testcase_09 RE -
testcase_10 AC 98 ms
12,288 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 {|sum, n| sum * n } / arr[0]
    puts "#{a[0]} #{i}"
end
0