結果

問題 No.36 素数が嫌い!
ユーザー DialBirdDialBird
提出日時 2017-02-12 19:56:19
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,077 ms / 5,000 ms
コード長 271 bytes
コンパイル時間 78 ms
コンパイル使用メモリ 11,252 KB
実行使用メモリ 15,576 KB
最終ジャッジ日時 2023-09-09 07:48:16
合計ジャッジ時間 8,012 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 325 ms
15,384 KB
testcase_01 AC 107 ms
15,436 KB
testcase_02 AC 90 ms
15,316 KB
testcase_03 AC 89 ms
15,272 KB
testcase_04 AC 89 ms
15,308 KB
testcase_05 AC 91 ms
15,496 KB
testcase_06 AC 94 ms
15,248 KB
testcase_07 AC 93 ms
15,464 KB
testcase_08 AC 90 ms
15,352 KB
testcase_09 AC 91 ms
15,352 KB
testcase_10 AC 90 ms
15,188 KB
testcase_11 AC 412 ms
15,480 KB
testcase_12 AC 1,074 ms
15,312 KB
testcase_13 AC 1,077 ms
15,388 KB
testcase_14 AC 95 ms
15,464 KB
testcase_15 AC 90 ms
15,388 KB
testcase_16 AC 90 ms
15,188 KB
testcase_17 AC 91 ms
15,112 KB
testcase_18 AC 89 ms
15,348 KB
testcase_19 AC 130 ms
15,568 KB
testcase_20 AC 124 ms
15,576 KB
testcase_21 AC 223 ms
15,340 KB
testcase_22 AC 106 ms
15,380 KB
testcase_23 AC 97 ms
15,248 KB
testcase_24 AC 231 ms
15,488 KB
testcase_25 AC 259 ms
15,572 KB
testcase_26 AC 435 ms
15,340 KB
testcase_27 AC 107 ms
15,360 KB
testcase_28 AC 429 ms
15,540 KB
testcase_29 AC 96 ms
15,328 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require 'prime'

class Solve
  def initialize
    n = gets.to_i
    @factorial_list = n.prime_division
  end

  def run
    count = 0
    @factorial_list.each do |_, x|
      count += x
    end
    return "YES" if count >= 3
    return "NO"
  end

end

puts Solve.new.run
0