結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 97 ms
15,160 KB
testcase_01 AC 94 ms
15,436 KB
testcase_02 AC 95 ms
15,140 KB
testcase_03 AC 93 ms
15,116 KB
testcase_04 AC 97 ms
15,220 KB
testcase_05 AC 97 ms
15,324 KB
testcase_06 AC 98 ms
15,296 KB
testcase_07 AC 97 ms
15,316 KB
testcase_08 AC 99 ms
15,308 KB
testcase_09 AC 97 ms
15,388 KB
testcase_10 AC 97 ms
15,220 KB
testcase_11 WA -
testcase_12 AC 97 ms
15,300 KB
testcase_13 AC 92 ms
15,420 KB
testcase_14 AC 92 ms
15,356 KB
testcase_15 AC 91 ms
15,348 KB
testcase_16 AC 90 ms
15,404 KB
testcase_17 AC 91 ms
15,392 KB
testcase_18 AC 92 ms
15,316 KB
testcase_19 AC 90 ms
15,156 KB
testcase_20 AC 91 ms
15,360 KB
testcase_21 AC 93 ms
15,196 KB
testcase_22 AC 91 ms
15,216 KB
testcase_23 AC 92 ms
15,356 KB
testcase_24 AC 91 ms
15,156 KB
testcase_25 AC 92 ms
15,380 KB
testcase_26 AC 91 ms
15,228 KB
testcase_27 AC 95 ms
15,152 KB
testcase_28 WA -
testcase_29 AC 92 ms
15,208 KB
testcase_30 AC 91 ms
15,380 KB
testcase_31 AC 93 ms
15,096 KB
testcase_32 AC 91 ms
15,436 KB
testcase_33 AC 89 ms
15,100 KB
testcase_34 AC 92 ms
15,320 KB
testcase_35 AC 92 ms
15,436 KB
testcase_36 AC 95 ms
15,404 KB
testcase_37 AC 91 ms
15,412 KB
testcase_38 AC 94 ms
15,468 KB
testcase_39 AC 91 ms
15,200 KB
testcase_40 AC 91 ms
15,408 KB
testcase_41 AC 91 ms
15,444 KB
testcase_42 AC 92 ms
15,220 KB
testcase_43 AC 92 ms
15,216 KB
testcase_44 AC 92 ms
15,348 KB
testcase_45 AC 91 ms
15,124 KB
testcase_46 AC 92 ms
15,480 KB
testcase_47 AC 92 ms
15,144 KB
testcase_48 AC 92 ms
15,340 KB
testcase_49 AC 92 ms
15,188 KB
testcase_50 AC 92 ms
15,252 KB
testcase_51 AC 93 ms
15,116 KB
testcase_52 AC 92 ms
15,328 KB
testcase_53 AC 91 ms
15,192 KB
testcase_54 AC 92 ms
15,344 KB
testcase_55 AC 94 ms
15,316 KB
testcase_56 AC 92 ms
15,384 KB
testcase_57 AC 92 ms
15,204 KB
testcase_58 AC 91 ms
15,152 KB
testcase_59 AC 91 ms
15,408 KB
testcase_60 AC 91 ms
15,404 KB
testcase_61 AC 92 ms
15,344 KB
testcase_62 AC 90 ms
15,356 KB
testcase_63 AC 90 ms
15,160 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 Math::sqrt(n).to_i**2 == n
    puts 'Rippousu!'; exit
elsif n == 6 || n == 28
    puts 'Kanzensu!'
else
    p n
end
0