結果

問題 No.36 素数が嫌い!
ユーザー suppy193suppy193
提出日時 2017-01-27 15:43:57
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 240 bytes
コンパイル時間 77 ms
コンパイル使用メモリ 11,564 KB
実行使用メモリ 15,608 KB
最終ジャッジ日時 2023-08-25 03:37:46
合計ジャッジ時間 16,102 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 786 ms
15,504 KB
testcase_01 AC 110 ms
15,504 KB
testcase_02 AC 92 ms
15,228 KB
testcase_03 AC 91 ms
15,224 KB
testcase_04 WA -
testcase_05 AC 98 ms
15,388 KB
testcase_06 AC 102 ms
15,500 KB
testcase_07 AC 102 ms
15,516 KB
testcase_08 AC 92 ms
15,212 KB
testcase_09 AC 91 ms
15,324 KB
testcase_10 AC 91 ms
15,156 KB
testcase_11 AC 1,058 ms
15,436 KB
testcase_12 AC 3,060 ms
15,588 KB
testcase_13 WA -
testcase_14 AC 99 ms
15,372 KB
testcase_15 AC 89 ms
15,212 KB
testcase_16 AC 90 ms
15,212 KB
testcase_17 AC 89 ms
15,204 KB
testcase_18 AC 91 ms
15,412 KB
testcase_19 AC 129 ms
15,376 KB
testcase_20 AC 122 ms
15,404 KB
testcase_21 AC 220 ms
15,428 KB
testcase_22 AC 107 ms
15,312 KB
testcase_23 AC 96 ms
15,316 KB
testcase_24 AC 234 ms
15,400 KB
testcase_25 AC 616 ms
15,412 KB
testcase_26 AC 1,130 ms
15,608 KB
testcase_27 AC 148 ms
15,520 KB
testcase_28 AC 1,106 ms
15,452 KB
testcase_29 AC 114 ms
15,308 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require 'prime'

n = gets.strip.to_i
if n.prime_division.length > 2
	puts "YES\n"
elsif n.prime_division.length == 0
	puts "NO\n"
else
	n.prime_division.each do |primes|
		if primes[1] > 1
			puts "YES\n"
			exit
		end
	end
	puts "NO\n"
end
0