結果

問題 No.36 素数が嫌い!
ユーザー zazaboon
提出日時 2017-01-23 17:27:19
言語 Ruby
(3.4.1)
結果
WA  
実行時間 -
コード長 214 bytes
コンパイル時間 37 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 12,160 KB
最終ジャッジ日時 2024-12-23 07:40:20
合計ジャッジ時間 16,343 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 17 WA * 9
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:2: warning: parentheses after method name is interpreted as an argument list, not a decomposed argument
Syntax OK

ソースコード

diff #

a = gets.chomp.to_i
def divisor_list2 (a)
  return [1] if a == 1
  (1..Math.sqrt(a).to_i).select do |i|
    a%i == 0
  end.map {|e| [e, a/e]}.flatten.uniq.sort
end
c = divisor_list2(a)
puts (c.size>2)? "YES" : "NO"
0