結果

問題 No.36 素数が嫌い!
ユーザー zazaboonzazaboon
提出日時 2017-01-23 17:27:19
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 214 bytes
コンパイル時間 234 ms
コンパイル使用メモリ 11,440 KB
実行使用メモリ 15,376 KB
最終ジャッジ日時 2023-08-24 21:33:38
合計ジャッジ時間 16,002 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 517 ms
15,080 KB
testcase_01 AC 810 ms
15,336 KB
testcase_02 AC 81 ms
15,292 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 83 ms
15,240 KB
testcase_08 AC 80 ms
15,288 KB
testcase_09 AC 82 ms
15,248 KB
testcase_10 AC 82 ms
15,280 KB
testcase_11 AC 384 ms
15,288 KB
testcase_12 AC 1,018 ms
15,132 KB
testcase_13 WA -
testcase_14 AC 661 ms
15,248 KB
testcase_15 AC 80 ms
15,248 KB
testcase_16 AC 80 ms
15,128 KB
testcase_17 AC 80 ms
15,084 KB
testcase_18 AC 79 ms
15,084 KB
testcase_19 AC 444 ms
15,292 KB
testcase_20 AC 1,011 ms
15,236 KB
testcase_21 AC 799 ms
15,036 KB
testcase_22 AC 823 ms
15,128 KB
testcase_23 AC 520 ms
15,112 KB
testcase_24 AC 582 ms
15,280 KB
testcase_25 AC 563 ms
15,244 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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