結果

問題 No.36 素数が嫌い!
ユーザー tanukidon
提出日時 2018-03-24 10:58:48
言語 Ruby
(3.4.1)
結果
WA  
実行時間 -
コード長 185 bytes
コンパイル時間 130 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 19,356 KB
最終ジャッジ日時 2024-06-25 02:44:22
合計ジャッジ時間 7,191 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 4
other AC * 2 WA * 3 TLE * 1 -- * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
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