結果

問題 No.36 素数が嫌い!
ユーザー simansiman
提出日時 2015-04-02 22:23:29
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 269 bytes
コンパイル時間 51 ms
コンパイル使用メモリ 11,268 KB
実行使用メモリ 15,596 KB
最終ジャッジ日時 2023-09-17 01:25:12
合計ジャッジ時間 7,873 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 293 ms
15,284 KB
testcase_01 AC 99 ms
15,400 KB
testcase_02 AC 79 ms
15,384 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 83 ms
15,416 KB
testcase_08 AC 80 ms
15,180 KB
testcase_09 AC 81 ms
15,308 KB
testcase_10 AC 80 ms
15,212 KB
testcase_11 AC 376 ms
15,292 KB
testcase_12 AC 980 ms
15,376 KB
testcase_13 WA -
testcase_14 AC 90 ms
15,476 KB
testcase_15 AC 82 ms
15,080 KB
testcase_16 AC 85 ms
15,196 KB
testcase_17 AC 88 ms
15,328 KB
testcase_18 AC 86 ms
15,348 KB
testcase_19 AC 124 ms
15,488 KB
testcase_20 AC 119 ms
15,396 KB
testcase_21 AC 209 ms
15,496 KB
testcase_22 AC 98 ms
15,336 KB
testcase_23 AC 91 ms
15,400 KB
testcase_24 AC 214 ms
15,344 KB
testcase_25 AC 241 ms
15,280 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require 'prime'

class Yukicoder
  def initialize
    n = gets.chomp.to_i

    prime_list = n.prime_division

    if prime_list.size.zero? || (prime_list.size == 1 && prime_list.first.last == 1)
      puts 'NO'
    else
      puts 'YES'
    end
  end
end

Yukicoder.new
0