結果

問題 No.36 素数が嫌い!
ユーザー gemmarogemmaro
提出日時 2020-06-26 11:30:10
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,073 ms / 5,000 ms
コード長 226 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 11,280 KB
実行使用メモリ 15,576 KB
最終ジャッジ日時 2023-09-16 23:39:05
合計ジャッジ時間 8,378 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 324 ms
15,348 KB
testcase_01 AC 108 ms
15,488 KB
testcase_02 AC 90 ms
15,100 KB
testcase_03 AC 90 ms
15,412 KB
testcase_04 AC 89 ms
15,100 KB
testcase_05 AC 91 ms
15,468 KB
testcase_06 AC 93 ms
15,344 KB
testcase_07 AC 96 ms
15,240 KB
testcase_08 AC 90 ms
15,312 KB
testcase_09 AC 90 ms
15,060 KB
testcase_10 AC 90 ms
15,300 KB
testcase_11 AC 411 ms
15,316 KB
testcase_12 AC 1,073 ms
15,296 KB
testcase_13 AC 1,073 ms
15,560 KB
testcase_14 AC 93 ms
15,360 KB
testcase_15 AC 89 ms
15,280 KB
testcase_16 AC 91 ms
15,152 KB
testcase_17 AC 89 ms
15,492 KB
testcase_18 AC 97 ms
15,372 KB
testcase_19 AC 131 ms
15,560 KB
testcase_20 AC 121 ms
15,564 KB
testcase_21 AC 220 ms
15,488 KB
testcase_22 AC 105 ms
15,372 KB
testcase_23 AC 95 ms
15,576 KB
testcase_24 AC 230 ms
15,268 KB
testcase_25 AC 260 ms
15,508 KB
testcase_26 AC 436 ms
15,480 KB
testcase_27 AC 106 ms
15,228 KB
testcase_28 AC 429 ms
15,344 KB
testcase_29 AC 97 ms
15,500 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

# frozen_string_literal: true

def solve
  require 'prime'
  h = Prime.prime_division(N).to_h
  h.size >= 3 || h.values.find { _1 >= 3 } || h.size >= 2 && h.values.find { _1 >= 2 } ? 'YES' : 'NO'
end

N = gets.to_i

puts solve
0