結果

問題 No.889 素数!
ユーザー maimai
提出日時 2019-09-20 21:36:47
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 271 bytes
コンパイル時間 50 ms
コンパイル使用メモリ 11,520 KB
実行使用メモリ 15,836 KB
最終ジャッジ日時 2023-10-12 18:18:56
合計ジャッジ時間 8,065 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 96 ms
15,328 KB
testcase_01 AC 91 ms
15,648 KB
testcase_02 AC 90 ms
15,208 KB
testcase_03 AC 91 ms
15,312 KB
testcase_04 AC 90 ms
15,232 KB
testcase_05 AC 90 ms
15,144 KB
testcase_06 AC 90 ms
15,224 KB
testcase_07 AC 89 ms
15,196 KB
testcase_08 AC 90 ms
15,208 KB
testcase_09 AC 90 ms
15,528 KB
testcase_10 AC 90 ms
15,312 KB
testcase_11 WA -
testcase_12 AC 90 ms
15,104 KB
testcase_13 AC 91 ms
15,652 KB
testcase_14 AC 90 ms
15,516 KB
testcase_15 AC 90 ms
15,680 KB
testcase_16 AC 93 ms
15,312 KB
testcase_17 AC 91 ms
15,528 KB
testcase_18 AC 89 ms
15,308 KB
testcase_19 AC 91 ms
15,816 KB
testcase_20 AC 90 ms
15,344 KB
testcase_21 AC 89 ms
15,692 KB
testcase_22 AC 90 ms
15,500 KB
testcase_23 AC 91 ms
15,580 KB
testcase_24 AC 89 ms
15,208 KB
testcase_25 AC 91 ms
15,648 KB
testcase_26 AC 92 ms
15,448 KB
testcase_27 AC 91 ms
15,508 KB
testcase_28 WA -
testcase_29 AC 93 ms
15,684 KB
testcase_30 AC 91 ms
15,180 KB
testcase_31 AC 90 ms
15,580 KB
testcase_32 AC 90 ms
15,128 KB
testcase_33 AC 91 ms
15,572 KB
testcase_34 AC 90 ms
15,836 KB
testcase_35 AC 95 ms
15,536 KB
testcase_36 AC 91 ms
15,576 KB
testcase_37 AC 91 ms
15,360 KB
testcase_38 AC 91 ms
15,692 KB
testcase_39 AC 90 ms
15,788 KB
testcase_40 AC 91 ms
15,676 KB
testcase_41 AC 90 ms
15,324 KB
testcase_42 AC 90 ms
15,628 KB
testcase_43 AC 92 ms
15,176 KB
testcase_44 AC 95 ms
15,580 KB
testcase_45 AC 90 ms
15,680 KB
testcase_46 AC 91 ms
15,688 KB
testcase_47 AC 90 ms
15,496 KB
testcase_48 AC 91 ms
15,796 KB
testcase_49 AC 91 ms
15,328 KB
testcase_50 AC 91 ms
15,500 KB
testcase_51 AC 90 ms
15,604 KB
testcase_52 AC 90 ms
15,500 KB
testcase_53 AC 90 ms
15,128 KB
testcase_54 AC 90 ms
15,572 KB
testcase_55 AC 91 ms
15,604 KB
testcase_56 AC 90 ms
15,716 KB
testcase_57 AC 90 ms
15,568 KB
testcase_58 AC 90 ms
15,704 KB
testcase_59 AC 90 ms
15,088 KB
testcase_60 AC 90 ms
15,708 KB
testcase_61 AC 92 ms
15,352 KB
testcase_62 AC 92 ms
15,508 KB
testcase_63 AC 91 ms
15,700 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require 'prime'
n = gets.to_i
if n <= 1
    p n; exit
elsif n.prime?
    puts 'Sosu!'; exit
elsif Math::sqrt(n).to_i**2 == n
    puts 'Heihosu!'; exit
elsif (n**(1.0/3)).to_i**3 == n
    puts 'Rippousu!'; exit
elsif n == 6 || n == 28
    puts 'Kanzensu!'
else
    p n
end
0