結果

問題 No.36 素数が嫌い!
ユーザー tanukidontanukidon
提出日時 2018-03-24 10:58:48
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 185 bytes
コンパイル時間 54 ms
コンパイル使用メモリ 11,312 KB
実行使用メモリ 15,240 KB
最終ジャッジ日時 2023-09-07 08:23:29
合計ジャッジ時間 7,052 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
15,096 KB
testcase_01 AC 88 ms
15,240 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:5: warning: `if' at the end of line without an expression
Syntax OK

ソースコード

diff #

n = gets.to_i
c = 0
n.times do |i|
c += 1 if n % (i+1) == 0
if
c > 2
break
end
end
if n == 1
  puts "NO"
elsif n == 2
  puts "YES"
elsif c == 3
  puts "YES"
elsif c == 2
  puts "NO"
end
0